pub struct MemoryPool { /* private fields */ }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>
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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>
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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>
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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)>
Use jemalloc feature instead. See buddy_allocator module docs for migration.
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
Use jemalloc feature instead. See buddy_allocator module docs for migration.
Get total free bytes