pub struct ThreadSafeSlabAllocator { /* private fields */ }Expand description
Thread-safe slab allocator wrapper
Implementations§
Source§impl ThreadSafeSlabAllocator
impl ThreadSafeSlabAllocator
pub fn new(base_ptr: NonNull<u8>, total_size: usize, config: SlabConfig) -> Self
pub fn allocate(&self, size: usize) -> Result<NonNull<u8>, SlabError>
pub fn deallocate(&self, ptr: NonNull<u8>, size: usize) -> Result<(), SlabError>
pub fn get_stats(&self) -> SlabAllocatorStats
pub fn reclaim_memory(&self) -> usize
Auto Trait Implementations§
impl Freeze for ThreadSafeSlabAllocator
impl RefUnwindSafe for ThreadSafeSlabAllocator
impl Send for ThreadSafeSlabAllocator
impl Sync for ThreadSafeSlabAllocator
impl Unpin for ThreadSafeSlabAllocator
impl UnwindSafe for ThreadSafeSlabAllocator
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more