alloc_traits/lib.rs
1//! Traits to replace or supplement the alloc module in `no_std`.
2//!
3//! Defines traits, similar to `alloc::GlobalAlloc`, that can be implemented to defined different
4//! kinds of allocators. Unlike the standard library one they do not presume global uniqueness and
5//! static lifetime of the memory resource provider. In return, the allocators are not required to
6//! implement the `Sync` bound and can easily be built without operating system support to be
7//! usable.
8//!
9//! There are additional independent crates with additional abstractions on-top:
10//! * [`static-alloc`]: A simple allocator drawing from a memory region statically
11//! embedded within the compiled binary.
12//! * [`without-alloc`]: A set of data structures (`Box`, `Vec`, `Rc`, ...) that can
13//! be allocated from the implementors of the traits defined here.
14//!
15//! [`static-alloc`]: https://crates.io/crates/static-alloc
16//! [`without-alloc`]: https://crates.io/crates/without-alloc
17
18// Copyright 2019 Andreas Molzer
19#![no_std]
20#![deny(missing_docs)]
21
22mod layout;
23mod local;
24pub mod util;
25
26pub use crate::layout::{Layout, NonZeroLayout};
27pub use crate::local::{AllocTime, Allocation, LocalAlloc};
28#[allow(deprecated)]
29pub use crate::local::Invariant;