Struct oxischeme::heap::Arena
[-]
[+]
[src]
pub struct Arena<T> { // some fields omitted }
An arena from which to allocate T
objects from.
Methods
impl<T: Default> Arena<T>
fn new(capacity: usize) -> Box<Arena<T>>
Create a new Arena
with the capacity to allocate the given number of
T
instances.
fn capacity(&self) -> usize
Get this heap's capacity for simultaneously allocated cons cells.
fn is_full(&self) -> bool
Return true if this arena is at full capacity, and false otherwise.
fn is_empty(&self) -> bool
Return true if this arena does not contain any reachable objects (ie, the free list is full), and false otherwise.
fn allocate(&mut self) -> ArenaPtr<T>
Allocate a new T
instance and return a pointer to it.
Panics
Panics when this arena's pool is already at capacity.
fn sweep(&mut self)
Sweep the arena and add any reclaimed objects back to the free list.