#[non_exhaustive]pub struct AllocStats {
pub alloc_count: u64,
pub total_bytes: u64,
pub peak_bytes: u64,
pub current_bytes: u64,
pub live_count: u64,
pub peak_live_count: u64,
}Expand description
Snapshot of allocation statistics at a point in time.
Produced by ModAlloc::snapshot and Profiler::stop.
§Example
use mod_alloc::AllocStats;
// Construct via Default (literal construction is closed off as
// of v1.0 — see "Stability" below).
let mut stats = AllocStats::default();
stats.alloc_count = 10;
stats.total_bytes = 1024;
assert_eq!(stats.alloc_count, 10);§Stability
Marked #[non_exhaustive] as of v1.0.0. New counter fields may
be added in future minor versions without bumping the major
version. Construct via AllocStats::default (or consume
snapshots from ModAlloc::snapshot / Profiler::stop)
rather than struct-literal syntax. Reading individual fields by
name is fully stable.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.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).
live_count: u64Currently-alive allocation count (allocations minus
deallocations). Mirrors dhat::HeapStats::curr_blocks.
peak_live_count: u64Peak live allocation count (highest live_count ever
observed). Mirrors dhat::HeapStats::max_blocks.
Trait Implementations§
Source§impl Clone for AllocStats
impl Clone for AllocStats
Source§fn clone(&self) -> AllocStats
fn clone(&self) -> AllocStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§impl PartialEq for AllocStats
impl PartialEq for AllocStats
Source§fn eq(&self, other: &AllocStats) -> bool
fn eq(&self, other: &AllocStats) -> bool
self and other values to be equal, and is used by ==.