[src]

Struct ncollide2df64::util::owned_allocation_cache::OwnedAllocationCache

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

Cache for owned objects.

Useful if fast allocation/deallocation of small owned objects is needed.

Methods

impl<T> OwnedAllocationCache<T>

fn new() -> OwnedAllocationCache<T>

Initializes the cache.

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

Box a value into a potentially already allocated box.

fn retain(&mut self, elem: ~T)

Retains a box which can be re-used by the box method.

fn clear(&mut self)

Clears the cache, destroying any stored pointer.