lib.rs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. extern crate unborrow;
  23. #[cfg(feature = "libc_write")]
  24. #[macro_use]
  25. mod write;
  26. #[macro_use]
  27. mod log;
  28. #[macro_use]
  29. mod tls;
  30. #[cfg(feature = "allocator")]
  31. mod symbols;
  32. mod allocator;
  33. mod block;
  34. mod bookkeeper;
  35. mod brk;
  36. mod cell;
  37. mod fail;
  38. mod lazy_init;
  39. mod leak;
  40. mod prelude;
  41. mod ptr;
  42. mod sync;
  43. mod sys;
  44. mod vec;
  45. pub use allocator::{alloc, free, realloc, realloc_inplace};
  46. pub use fail::{set_oom_handler, set_thread_oom_handler};
  47. pub use sys::sbrk;