pub struct ThreadSafeUnifiedAllocator { /* private fields */ }Expand description
Thread-safe unified allocator wrapper
Implementations§
Source§impl ThreadSafeUnifiedAllocator
impl ThreadSafeUnifiedAllocator
pub fn new( base_ptr: NonNull<u8>, total_size: usize, config: UnifiedConfig, ) -> Result<Self, AllocationError>
pub fn allocate(&self, size: usize) -> Result<NonNull<u8>, AllocationError>
pub fn deallocate( &self, ptr: NonNull<u8>, size: usize, ) -> Result<(), AllocationError>
pub fn get_stats(&self) -> UnifiedStats
pub fn garbage_collect(&self) -> GarbageCollectionResult
Auto Trait Implementations§
impl Freeze for ThreadSafeUnifiedAllocator
impl RefUnwindSafe for ThreadSafeUnifiedAllocator
impl Send for ThreadSafeUnifiedAllocator
impl Sync for ThreadSafeUnifiedAllocator
impl Unpin for ThreadSafeUnifiedAllocator
impl UnsafeUnpin for ThreadSafeUnifiedAllocator
impl UnwindSafe for ThreadSafeUnifiedAllocator
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