Struct blink_alloc::BlinkAllocCache
source · pub struct BlinkAllocCache<A: Allocator = Global> { /* private fields */ }
Expand description
Multi-thread cache for BlinkAlloc
instances.
Stores pushed BlinkAlloc
instances and returns them on pop.
Blink-allocators are kept warm in the cache.
This type is internally synchronized with hybrid blocking + wait-free algorithm.
Implementations§
source§impl<A> BlinkAllocCache<A>where
A: Allocator,
impl<A> BlinkAllocCache<A>where A: Allocator,
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new empty BlinkAllocCache
.
sourcepub fn pop(&self) -> Option<BlinkAlloc<A>>
pub fn pop(&self) -> Option<BlinkAlloc<A>>
Acquires some BlinkAlloc
instance from the cache.
Returns none if the cache is empty.