pub struct SlabAllocator { /* private fields */ }👎Deprecated since 0.2.0:
Use jemalloc feature instead. See buddy_allocator module docs for migration.
Expand description
Slab allocator built on top of buddy allocator for fixed-size objects
Implementations§
Source§impl SlabAllocator
impl SlabAllocator
Sourcepub fn new(object_size: usize) -> Self
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn new(object_size: usize) -> Self
Use jemalloc feature instead. See buddy_allocator module docs for migration.
Create a new slab allocator for objects of the given size
Sourcepub fn allocate(&self) -> Result<usize, BuddyError>
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn allocate(&self) -> Result<usize, BuddyError>
Use jemalloc feature instead. See buddy_allocator module docs for migration.
Allocate one object
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.
Deallocate an object
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 statistics
Sourcepub fn object_size(&self) -> usize
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn object_size(&self) -> usize
Use jemalloc feature instead. See buddy_allocator module docs for migration.
Get object size
Auto Trait Implementations§
impl !Freeze for SlabAllocator
impl !RefUnwindSafe for SlabAllocator
impl Send for SlabAllocator
impl Sync for SlabAllocator
impl Unpin for SlabAllocator
impl UnsafeUnpin for SlabAllocator
impl UnwindSafe for SlabAllocator
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