pub struct AtomicMemoryStats {
pub total_allocations: AtomicU64,
pub total_allocated: AtomicU64,
pub active_allocations: AtomicU64,
pub active_memory: AtomicU64,
pub peak_allocations: AtomicU64,
pub peak_memory: AtomicU64,
pub total_deallocations: AtomicU64,
pub total_deallocated: AtomicU64,
pub leaked_allocations: AtomicU64,
pub leaked_memory: AtomicU64,
}Expand description
Atomic memory statistics for lock-free updates
Fields§
§total_allocations: AtomicU64Total number of allocations made
total_allocated: AtomicU64Total bytes allocated
active_allocations: AtomicU64Current number of active allocations
active_memory: AtomicU64Current active memory in bytes
peak_allocations: AtomicU64Peak number of allocations
peak_memory: AtomicU64Peak memory usage in bytes
total_deallocations: AtomicU64Number of deallocations
total_deallocated: AtomicU64Total bytes deallocated
leaked_allocations: AtomicU64Number of leaked allocations
leaked_memory: AtomicU64Bytes in leaked allocations
Implementations§
Source§impl AtomicMemoryStats
impl AtomicMemoryStats
Sourcepub fn record_allocation(&self, size: u64)
pub fn record_allocation(&self, size: u64)
Record a new allocation
Sourcepub fn record_deallocation(&self, size: u64)
pub fn record_deallocation(&self, size: u64)
Record a deallocation
Sourcepub fn record_leak(&self, size: u64)
pub fn record_leak(&self, size: u64)
Record a leaked allocation
Sourcepub fn snapshot(&self) -> MemoryStatsSnapshot
pub fn snapshot(&self) -> MemoryStatsSnapshot
Get a snapshot of current statistics
Trait Implementations§
Source§impl Debug for AtomicMemoryStats
impl Debug for AtomicMemoryStats
Auto Trait Implementations§
impl !Freeze for AtomicMemoryStats
impl RefUnwindSafe for AtomicMemoryStats
impl Send for AtomicMemoryStats
impl Sync for AtomicMemoryStats
impl Unpin for AtomicMemoryStats
impl UnwindSafe for AtomicMemoryStats
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more