pub struct ArenaStatsExt {
pub bytes_allocated: usize,
pub alloc_count: usize,
pub chunk_count: usize,
pub wasted_bytes: usize,
}Expand description
Statistics collected from an arena allocator.
Fields§
§bytes_allocated: usizeTotal bytes allocated.
alloc_count: usizeTotal number of allocations performed.
chunk_count: usizeNumber of chunks allocated.
wasted_bytes: usizeWasted bytes due to alignment padding.
Implementations§
Source§impl ArenaStatsExt
impl ArenaStatsExt
Sourcepub fn avg_alloc_size(&self) -> f64
pub fn avg_alloc_size(&self) -> f64
Returns the average allocation size in bytes.
Sourcepub fn fragmentation(&self) -> f64
pub fn fragmentation(&self) -> f64
Returns the fragmentation ratio (wasted / total).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArenaStatsExt
impl RefUnwindSafe for ArenaStatsExt
impl Send for ArenaStatsExt
impl Sync for ArenaStatsExt
impl Unpin for ArenaStatsExt
impl UnsafeUnpin for ArenaStatsExt
impl UnwindSafe for ArenaStatsExt
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