[−][src]Trait allocator_suite::allocators::allocator::Allocator
A helper trait that brings together the core, common functionality required to implement the traits GlobalAlloc
and Alloc
.
Associated Constants
const ZERO_SIZED_ALLOCATION: MemoryAddress
The sentinel value used for a zero-sized allocation.
Required methods
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
Allocate memory.
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
Deallocate (free) memory.
The parameter memory
will never be the value Self::ZERO_SIZED_ALLOCATION
and will always have been allocated by this Allocator
.
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
Reallocate memory by growing it.
non_zero_new_size
will always be greater than non_zero_current_size
.
non_zero_power_of_two_alignment
will be the same value as passed to allocate()
.
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
Reallocate memory by shrinking it.
non_zero_new_size
will always be less than non_zero_current_size
.
non_zero_power_of_two_alignment
will be the same value as passed to allocate()
.
Provided methods
fn adapt<'a>(&'a self) -> AllocatorAdaptor<'a, Self>
Adapts to a GlobalAlloc
and Alloc
.
fn adapt_reference<'a>(&'a self) -> &'a AllocatorAdaptor<'a, Self>
Adapts a reference to a GlobalAlloc
and Alloc
reference.
Implementors
impl Allocator for MemoryMapAllocator
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<'a, A: 'a + Allocator> Allocator for AllocatorAdaptor<'a, A>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<A: Alloc> Allocator for AllocToAllocatorAdaptor<A>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<GA: GlobalAlloc> Allocator for GlobalAllocToAllocatorAdaptor<GA>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<MS: MemorySource> Allocator for ContextAllocator<MS>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<MS: MemorySource> Allocator for BitSetAllocator<MS>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<MS: MemorySource> Allocator for BumpAllocator<MS>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
_non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
_non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
_non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
_non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<MemoryAddress, AllocErr>
impl<MS: MemorySource> Allocator for MultipleBinarySearchTreeAllocator<MS>
[src]
fn allocate(
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
[src]
&self,
non_zero_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize
) -> Result<MemoryAddress, AllocErr>
fn deallocate(
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
[src]
&self,
non_zero_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
current_memory: MemoryAddress
)
fn growing_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<NonNull<u8>, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<NonNull<u8>, AllocErr>
fn shrinking_reallocate(
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<NonNull<u8>, AllocErr>
[src]
&self,
non_zero_new_size: NonZeroUsize,
_non_zero_power_of_two_alignment: NonZeroUsize,
non_zero_current_size: NonZeroUsize,
current_memory: MemoryAddress
) -> Result<NonNull<u8>, AllocErr>