Struct allocators::HeapAllocator
[−]
[src]
pub struct HeapAllocator;
Allocator stub that just forwards to heap allocation.
It is recommended to use the HEAP
constant instead
of creating a new instance of this, to benefit from
the static lifetime that it provides.
Trait Implementations
impl Debug for HeapAllocator
[src]
impl Allocator for HeapAllocator
[src]
unsafe fn allocate_raw(&self, size: usize, align: usize) -> Result<Block, AllocatorError>
Attempt to allocate a block of memory. Read more
unsafe fn deallocate_raw(&self, blk: Block)
Deallocate the memory referred to by this pointer. Read more
fn allocate<T>(&self, val: T) -> Result<Allocated<T, Self>, (AllocatorError, T)> where Self: Sized
Attempts to allocate the value supplied to it. Read more
fn make_place<T>(&self) -> Result<Place<T, Self>, AllocatorError> where Self: Sized
Attempts to create a place to allocate into. For the general purpose, calling allocate
on the allocator is enough. However, when you know the value you are allocating is too large to be constructed on the stack, you should use in-place allocation. Read more