pub struct MemoryPool { /* private fields */ }👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
Expand description
A single memory pool managed by the buddy allocator
Implementations§
Source§impl MemoryPool
impl MemoryPool
Sourcepub fn new(base: usize, size: usize) -> Result<Self, BuddyError>
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn new(base: usize, size: usize) -> Result<Self, BuddyError>
Create a new memory pool with the given base address and size
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 a block of the given size
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>
Free a previously allocated block
Sourcepub fn contains(&self, addr: usize) -> bool
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn contains(&self, addr: usize) -> bool
Check if an address is within this pool
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 pool statistics
Sourcepub fn free_block_counts(&self) -> Vec<(u8, usize)>
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn free_block_counts(&self) -> Vec<(u8, usize)>
Get the number of free blocks at each order
Sourcepub fn free_bytes(&self) -> usize
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn free_bytes(&self) -> usize
Get total free bytes
Auto Trait Implementations§
impl !Freeze for MemoryPool
impl !RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin for MemoryPool
impl UnwindSafe for MemoryPool
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