Trait divans::alloc_util::Allocator [−][src]
pub trait Allocator<T> { type AllocatedMemory: AllocatedSlice<T>; fn alloc_cell(&mut self, len: usize) -> Self::AllocatedMemory; fn free_cell(&mut self, data: Self::AllocatedMemory); }
Associated Types
type AllocatedMemory: AllocatedSlice<T>
Required Methods
fn alloc_cell(&mut self, len: usize) -> Self::AllocatedMemory
fn free_cell(&mut self, data: Self::AllocatedMemory)
Implementations on Foreign Types
impl<T> Allocator<T> for HeapAlloc<T> where
T: Clone,
[src]
impl<T> Allocator<T> for HeapAlloc<T> where
T: Clone,
type AllocatedMemory = WrapBox<T>
fn alloc_cell(&mut self, len: usize) -> WrapBox<T>
[src]
fn alloc_cell(&mut self, len: usize) -> WrapBox<T>
fn free_cell(&mut self, _data: WrapBox<T>)
[src]
fn free_cell(&mut self, _data: WrapBox<T>)
Implementors
impl<'a, T, U> Allocator<T> for StackAllocator<'a, T, U> where
T: 'a,
U: AllocatedSlice<&'a mut [T]>, type AllocatedMemory = AllocatedStackMemory<'a, T>;impl<'a, T: 'a, AllocT: 'a + Allocator<T>, ShouldClear: ShouldClearCacheOnAlloc<T>> Allocator<T> for CachedAllocator<'a, T, AllocT, ShouldClear> type AllocatedMemory = AllocatedMemoryPrefix<T, AllocT>;
impl<T, AllocT: Allocator<T>> Allocator<T> for RepurposingAlloc<T, AllocT> type AllocatedMemory = AllocT::AllocatedMemory;