[−][src]Enum context_allocator::allocators::ContextAllocator
An allocator designed for contexts with different lifetimes.
This allocator NEVER grows or shrinks its memory region.
This allocator is not thread-safe.
Variants
ShortLived(BumpAllocator<MS>)
Use this variant for contexts with short-lived lifetimes.
Very fast allocation and almost costless deallocation, at the expense of the strong likelihood of running out of memory.
Reallocation is very expensive when growing unless reallocating the most recently made allocation.
MediumLived(BitSetAllocator<MS>)
Use this variant for contexts with slightly longer than short-lived lifetimes.
Slower allocation and deallocation but reallocation is less expensive than for ShortLived
.
LongLived(MultipleBinarySearchTreeAllocator<MS>)
Use this variant for contexts with long-lived lifetimes.
Trait Implementations
impl<MS: MemorySource> LocalAllocator for ContextAllocator<MS>
[src]
fn memory_range(&self) -> MemoryRange
[src]
fn contains(&self, from_memory_address: MemoryAddress) -> bool
[src]
Returns true
if this allocator is responsible for an allocation starting with the given from_memory_address
. Read more
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>
const ZeroSizedAllocation: MemoryAddress
[src]
The sentinel value used for a zero-sized allocation.
fn adapt<'a>(&'a self) -> AllocatorAdaptor<'a, Self>
[src]
Adapts to a GlobalAlloc
and Alloc
.
fn adapt_reference<'a>(&'a self) -> &'a AllocatorAdaptor<'a, Self>
[src]
Adapts a reference to a GlobalAlloc
and Alloc
reference.
impl<MS: Debug + MemorySource> Debug for ContextAllocator<MS>
[src]
Auto Trait Implementations
impl<MS> !Send for ContextAllocator<MS>
impl<MS> !Sync for ContextAllocator<MS>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,