Struct arena::TypedArenaExperimental [-]  [+] [src]

pub struct TypedArena<T> {
    // some fields omitted
}

A faster arena that can hold objects of only one type.

Safety note: Modifying objects in the arena that have already had their drop destructors run can cause leaks, because the destructor will not run again for these objects.

Methods

impl<T> TypedArena<T>

fn new() -> TypedArena<T>

Creates a new TypedArena with preallocated space for eight objects.

fn with_capacity(capacity: uint) -> TypedArena<T>

Creates a new TypedArena with preallocated space for the given number of objects.

fn alloc(&self, object: T) -> &mut T

Allocates an object in the TypedArena, returning a reference to it.

Trait Implementations

impl<T> Drop for TypedArena<T>

fn drop(&mut self)