pub struct ArenaAllocator { /* private fields */ }Expand description
The global arena allocator managing multiple epochs.
Implementations§
Source§impl ArenaAllocator
impl ArenaAllocator
Sourcepub fn with_chunk_size(chunk_size: usize) -> Self
pub fn with_chunk_size(chunk_size: usize) -> Self
Creates a new arena allocator with a custom chunk size.
Sourcepub fn current_epoch(&self) -> EpochId
pub fn current_epoch(&self) -> EpochId
Returns the current epoch.
Sourcepub fn drop_epoch(&self, epoch: EpochId)
pub fn drop_epoch(&self, epoch: EpochId)
Drops an epoch, freeing all its memory.
This should only be called when no readers are using this epoch.
Sourcepub fn total_allocated(&self) -> usize
pub fn total_allocated(&self) -> usize
Returns total memory allocated across all epochs.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ArenaAllocator
impl !RefUnwindSafe for ArenaAllocator
impl Send for ArenaAllocator
impl Sync for ArenaAllocator
impl Unpin for ArenaAllocator
impl UnwindSafe for ArenaAllocator
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