pub struct AllocStats {
pub regions_created: usize,
pub regions_freed: usize,
pub total_allocated: usize,
pub total_freed: usize,
pub peak_usage: usize,
}Expand description
Allocation statistics snapshot.
Fields§
§regions_created: usizeTotal number of regions ever created (including recycled).
regions_freed: usizeTotal number of regions freed (returned to the free list).
total_allocated: usizeTotal bytes allocated across all active regions.
total_freed: usizeTotal capacity freed (bytes in freed regions).
peak_usage: usizePeak in-use byte count observed.
Implementations§
Source§impl AllocStats
impl AllocStats
Sourcepub fn active_regions(&self) -> usize
pub fn active_regions(&self) -> usize
Net active regions (created minus freed).
Sourcepub fn utilization(&self, total_capacity: usize) -> f64
pub fn utilization(&self, total_capacity: usize) -> f64
Efficiency ratio: bytes allocated vs total capacity allocated so far.
Trait Implementations§
Source§impl Clone for AllocStats
impl Clone for AllocStats
Source§fn clone(&self) -> AllocStats
fn clone(&self) -> AllocStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AllocStats
impl Debug for AllocStats
Source§impl Default for AllocStats
impl Default for AllocStats
Source§fn default() -> AllocStats
fn default() -> AllocStats
Returns the “default value” for a type. Read more
Source§impl Display for AllocStats
impl Display for AllocStats
Source§impl PartialEq for AllocStats
impl PartialEq for AllocStats
impl Eq for AllocStats
impl StructuralPartialEq for AllocStats
Auto Trait Implementations§
impl Freeze for AllocStats
impl RefUnwindSafe for AllocStats
impl Send for AllocStats
impl Sync for AllocStats
impl Unpin for AllocStats
impl UnsafeUnpin for AllocStats
impl UnwindSafe for AllocStats
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