[][src]Enum allocator_suite::allocators::context_allocator::ContextAllocator

pub enum ContextAllocator<MS: MemorySource> {
    ShortLived(BumpAllocator<MS>),
    MediumLived(BitSetAllocator<MS>),
    LongLived(MultipleBinarySearchTreeAllocator<MS>),
}

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.

Use this variant for contexts with long-lived lifetimes.

Trait Implementations

impl<MS: MemorySource> LocalAllocator for ContextAllocator<MS>[src]

impl<MS: MemorySource> Allocator for ContextAllocator<MS>[src]

impl<MS: Debug + MemorySource> Debug for ContextAllocator<MS>[src]

Auto Trait Implementations

impl<MS> !Send for ContextAllocator<MS>

impl<MS> !Sync for ContextAllocator<MS>

impl<MS> Unpin for ContextAllocator<MS> where
    MS: Unpin

impl<MS> !UnwindSafe for ContextAllocator<MS>

impl<MS> !RefUnwindSafe for ContextAllocator<MS>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]