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.
pub fn push(&self, blink: BlinkAlloc<A>)
Trait Implementations§
Auto Trait Implementations§
impl<A = Global> !Freeze for BlinkAllocCache<A>
impl<A = Global> !RefUnwindSafe for BlinkAllocCache<A>
impl<A> Send for BlinkAllocCache<A>where
A: Send,
impl<A> Sync for BlinkAllocCache<A>where
A: Send,
impl<A> Unpin for BlinkAllocCache<A>where
A: Unpin,
impl<A = Global> !UnwindSafe for BlinkAllocCache<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more