Struct arena::Arena[src]
pub struct Arena {
// some fields omitted
}A slower reflection-based arena that can allocate objects of any type.
This arena uses Vec
As an optimization, objects with destructors are stored in different chunks than objects without destructors. This reduces overhead when initializing plain-old-data and means we don't need to waste time running the destructors of POD.
Methods
impl Arena
fn new() -> Arena
Allocate a new Arena with 32 bytes preallocated.
fn new_with_size(initial_size: uint) -> Arena
Allocate a new Arena with initial_size bytes preallocated.
impl Arena
fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T
Allocate a new item in the arena, using op to initialize the value
and returning a reference to it.