Struct scoped_allocator::ScopedAllocator [] [src]

pub struct ScopedAllocator<'parent, A: 'parent + Allocator> { /* fields omitted */ }

A scoped linear allocator

Methods

impl ScopedAllocator<'static, HeapAllocator>
[src]

Creates a new ScopedAllocator backed by size bytes from the heap.

impl<'parent, A: Allocator> ScopedAllocator<'parent, A>
[src]

Creates a new ScopedAllocator backed by size bytes from the allocator supplied.

Calls the supplied function with a new scope of the allocator.

Returns the result of the closure or an error if this allocator has already been scoped.

Trait Implementations

impl<'a, A: Allocator> Allocator for ScopedAllocator<'a, A>
[src]

Attempt to allocate a block of memory. Read more

Deallocate the memory referred to by this pointer. Read more

Attempts to allocate space for the value supplied to it. This incurs an expensive memcpy. If the performance of this allocation is important to you, it is recommended to use the in-place syntax with the allocate function. Read more

Attempts to create a place to allocate into.

impl<'a, A: Allocator> Drop for ScopedAllocator<'a, A>
[src]

Drops the ScopedAllocator