Skip to main content

cl_arena/
lib.rs

1//! Typed and dropless arena allocation, paraphrased from [the Rust Compiler's `rustc_arena`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_arena/src/lib.rs). See [LICENSE][1].
2//!
3//! An Arena Allocator is a type of allocator which provides stable locations for allocations within
4//! itself for the entire duration of its lifetime.
5//!
6//! [1]: https://raw.githubusercontent.com/rust-lang/rust/master/LICENSE-MIT
7
8#![cfg_attr(feature = "nightly", feature(dropck_eyepatch))]
9#![no_std]
10
11extern crate alloc;
12
13pub(crate) mod constants {
14    //! Size constants for arena chunk growth
15    pub(crate) const MIN_CHUNK: usize = 512;
16    pub(crate) const MAX_CHUNK: usize = 2 * 1024 * 1024;
17}
18
19mod chunk;
20
21#[cfg(feature = "nightly")]
22pub mod typed_arena;
23
24pub mod dropless_arena;