pub struct ChainedArena { /* private fields */ }Expand description
A chained-block arena that grows by adding new blocks on overflow.
Implementations§
Source§impl ChainedArena
impl ChainedArena
Sourcepub fn new(block_size: usize) -> Self
pub fn new(block_size: usize) -> Self
Creates a chained arena with the given initial block size.
Sourcepub fn alloc(&mut self, bytes: usize, align: usize) -> usize
pub fn alloc(&mut self, bytes: usize, align: usize) -> usize
Allocates bytes bytes with align alignment.
Sourcepub fn num_blocks(&self) -> usize
pub fn num_blocks(&self) -> usize
Returns the total number of blocks.
Sourcepub fn total_allocated(&self) -> usize
pub fn total_allocated(&self) -> usize
Returns total bytes allocated (excluding padding).
Auto Trait Implementations§
impl Freeze for ChainedArena
impl RefUnwindSafe for ChainedArena
impl Send for ChainedArena
impl Sync for ChainedArena
impl Unpin for ChainedArena
impl UnsafeUnpin for ChainedArena
impl UnwindSafe for ChainedArena
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