lib.rs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //! **Ralloc:** The memory efficient allocator.
  2. //!
  3. //! This crates define the user space allocator for Redox, which emphasizes performance and memory
  4. //! efficiency.
  5. //!
  6. //! # Ralloc seems to reimplement everything. Why?
  7. //!
  8. //! Memory allocators cannot depend on libraries or primitives, which allocates. This is a
  9. //! relatively strong condition, which means that you are forced to rewrite primitives and make
  10. //! sure no allocation ever happens.
  11. #![cfg_attr(feature = "allocator", allocator)]
  12. #![cfg_attr(feature = "clippy", feature(plugin))]
  13. #![cfg_attr(feature = "clippy", plugin(clippy))]
  14. #![no_std]
  15. #![feature(allocator, const_fn, core_intrinsics, stmt_expr_attributes, drop_types_in_const,
  16. nonzero, optin_builtin_traits, type_ascription, thread_local, linkage,
  17. try_from)]
  18. #![warn(missing_docs, cast_precision_loss, cast_sign_loss, cast_possible_wrap,
  19. cast_possible_truncation, filter_map, if_not_else, items_after_statements,
  20. invalid_upcast_comparisons, mutex_integer, nonminimal_bool, shadow_same, shadow_unrelated,
  21. single_match_else, string_add, string_add_assign, wrong_pub_self_convention)]
  22. #[macro_use]
  23. #[no_link]
  24. extern crate unborrow;
  25. extern crate ralloc_shim as shim;
  26. #[macro_use]
  27. mod log;
  28. #[macro_use]
  29. #[cfg(feature = "tls")]
  30. mod tls;
  31. #[cfg(feature = "allocator")]
  32. mod symbols;
  33. mod allocator;
  34. mod block;
  35. mod bookkeeper;
  36. mod brk;
  37. mod cell;
  38. mod fail;
  39. mod lazy_init;
  40. mod leak;
  41. mod prelude;
  42. mod ptr;
  43. mod sync;
  44. mod vec;
  45. pub use allocator::{alloc, free, realloc, realloc_inplace};
  46. pub use brk::sbrk;
  47. pub use fail::set_oom_handler;
  48. #[cfg(feature = "tls")]
  49. pub use fail::set_thread_oom_handler;