pub struct BuddyArena { /* private fields */ }👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
Expand description
Arena allocator using buddy allocator for backing storage
Implementations§
Source§impl BuddyArena
impl BuddyArena
Sourcepub fn new(block_size: usize) -> Self
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn new(block_size: usize) -> Self
Create a new arena with the specified block size
Sourcepub fn allocate(&self, size: usize, align: 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, align: usize) -> Result<usize, BuddyError>
Allocate from the arena (bump allocation)
Sourcepub fn allocate_val<T>(&self, _val: T) -> Result<usize, BuddyError>
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn allocate_val<T>(&self, _val: T) -> Result<usize, BuddyError>
Allocate a value and return its address
Sourcepub fn reset(&self)
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn reset(&self)
Reset the arena (free all blocks)
Sourcepub fn allocated_size(&self) -> usize
👎Deprecated since 0.2.0: Use jemalloc feature instead. See buddy_allocator module docs for migration.
pub fn allocated_size(&self) -> usize
Get total allocated size
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BuddyArena
impl !RefUnwindSafe for BuddyArena
impl Send for BuddyArena
impl Sync for BuddyArena
impl Unpin for BuddyArena
impl UnwindSafe for BuddyArena
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