pub struct AllocStats {
pub alloc_count: u64,
pub total_bytes: u64,
pub peak_bytes: u64,
pub current_bytes: u64,
}Expand description
Snapshot of allocation statistics at a point in time.
Produced by ModAlloc::snapshot and Profiler::stop.
§Example
use mod_alloc::AllocStats;
let stats = AllocStats {
alloc_count: 10,
total_bytes: 1024,
peak_bytes: 512,
current_bytes: 256,
};
assert_eq!(stats.alloc_count, 10);Fields§
§alloc_count: u64Number of allocations performed.
total_bytes: u64Total bytes allocated across all allocations. Reallocations contribute the growth delta (or zero on shrink).
peak_bytes: u64Peak resident bytes (highest current_bytes ever observed).
current_bytes: u64Currently-allocated bytes (allocations minus deallocations).
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 (const: unstable) · 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 PartialEq for AllocStats
impl PartialEq for AllocStats
Source§fn eq(&self, other: &AllocStats) -> bool
fn eq(&self, other: &AllocStats) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy 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