pub struct BuddyAllocator { /* private fields */ }๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
Expand description
Multi-pool buddy allocator
Implementationsยง
Sourceยงimpl BuddyAllocator
impl BuddyAllocator
Sourcepub fn new() -> Self
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn new() -> Self
Create a new buddy allocator with default settings
Sourcepub fn with_pool_size(pool_size: usize) -> Self
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn with_pool_size(pool_size: usize) -> Self
Create a new buddy allocator with the specified default pool size
Sourcepub fn add_pool(&self, size: usize) -> Result<usize, BuddyError>
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn add_pool(&self, size: usize) -> Result<usize, BuddyError>
Add a new memory pool
Sourcepub fn allocate(&self, size: usize) -> Result<usize, BuddyError>
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn allocate(&self, size: usize) -> Result<usize, BuddyError>
Allocate memory
Sourcepub fn deallocate(&self, addr: usize) -> Result<(), BuddyError>
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn deallocate(&self, addr: usize) -> Result<(), BuddyError>
Deallocate memory
Sourcepub fn stats(&self) -> &BuddyStats
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn stats(&self) -> &BuddyStats
Get global statistics
Sourcepub fn total_free_bytes(&self) -> usize
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn total_free_bytes(&self) -> usize
Get total free bytes across all pools
Sourcepub fn pool_count(&self) -> usize
๐Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn pool_count(&self) -> usize
Get number of pools
Trait Implementationsยง
Auto Trait Implementationsยง
impl !Freeze for BuddyAllocator
impl !RefUnwindSafe for BuddyAllocator
impl Send for BuddyAllocator
impl Sync for BuddyAllocator
impl Unpin for BuddyAllocator
impl UnwindSafe for BuddyAllocator
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