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
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>
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>
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
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
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 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
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