Struct scoped_allocator::HeapAllocator
[−]
[src]
pub struct HeapAllocator;
Allocator stub that just forwards to heap allocation.
Trait Implementations
impl Debug for HeapAllocator
[src]
impl Allocator for HeapAllocator
[src]
unsafe fn allocate_raw(
&self,
size: usize,
align: usize
) -> Result<*mut u8, AllocatorError>
&self,
size: usize,
align: usize
) -> Result<*mut u8, AllocatorError>
Attempt to allocate a block of memory. Read more
unsafe fn deallocate_raw(&self, ptr: *mut u8, size: usize, align: usize)
Deallocate the memory referred to by this pointer. Read more
fn allocate_val<'a, T>(
&'a self,
val: T
) -> Result<Allocated<'a, T, Self>, (AllocatorError, T)> where
Self: Sized,
&'a self,
val: T
) -> Result<Allocated<'a, T, Self>, (AllocatorError, T)> where
Self: Sized,
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
fn allocate<'a, T>(&'a self) -> Result<Place<'a, T, Self>, AllocatorError> where
Self: Sized,
Self: Sized,
Attempts to create a place to allocate into.