lib.rs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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, question_mark, thread_local, linkage)]
  17. #![warn(missing_docs, cast_precision_loss, cast_sign_loss, cast_possible_wrap,
  18. cast_possible_truncation, filter_map, if_not_else, items_after_statements,
  19. invalid_upcast_comparisons, mutex_integer, nonminimal_bool, shadow_same, shadow_unrelated,
  20. single_match_else, string_add, string_add_assign, wrong_pub_self_convention)]
  21. #[macro_use]
  22. #[no_link]
  23. extern crate unborrow;
  24. #[cfg(feature = "write")]
  25. #[macro_use]
  26. mod write;
  27. #[macro_use]
  28. mod log;
  29. #[macro_use]
  30. #[cfg(feature = "tls")]
  31. mod tls;
  32. #[cfg(feature = "allocator")]
  33. mod symbols;
  34. mod allocator;
  35. mod block;
  36. mod bookkeeper;
  37. mod brk;
  38. mod cell;
  39. mod fail;
  40. mod lazy_init;
  41. mod leak;
  42. mod prelude;
  43. mod ptr;
  44. mod sync;
  45. mod sys;
  46. mod vec;
  47. pub use allocator::{alloc, free, realloc, realloc_inplace};
  48. pub use fail::set_oom_handler;
  49. pub use sys::sbrk;
  50. #[cfg(feature = "tls")]
  51. pub use fail::set_thread_oom_handler;