pub struct ThreadSafeBuddyAllocator { /* private fields */ }Expand description
Thread-safe buddy allocator wrapper
Implementations§
Source§impl ThreadSafeBuddyAllocator
impl ThreadSafeBuddyAllocator
pub fn new( base_ptr: *mut u8, total_size: usize, config: BuddyConfig, ) -> Result<Self, BuddyError>
pub fn allocate(&self, size: usize) -> Result<*mut u8, BuddyError>
pub fn deallocate(&self, ptr: *mut u8) -> Result<(), BuddyError>
pub fn get_stats(&self) -> BuddyStats
pub fn get_memory_usage(&self) -> MemoryUsage
pub fn defragment(&self) -> usize
Auto Trait Implementations§
impl Freeze for ThreadSafeBuddyAllocator
impl RefUnwindSafe for ThreadSafeBuddyAllocator
impl Send for ThreadSafeBuddyAllocator
impl Sync for ThreadSafeBuddyAllocator
impl Unpin for ThreadSafeBuddyAllocator
impl UnwindSafe for ThreadSafeBuddyAllocator
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