#[repr(align(64))]pub struct SimpleMemoryStats {
pub allocation_count: AtomicU64,
pub total_allocated: AtomicU64,
/* private fields */
}
Expand description
Simple memory statistics optimized for cache line efficiency Hot path operations use only the first cache line (16 bytes)
Fields§
§allocation_count: AtomicU64
Hot path: allocation count (8 bytes)
total_allocated: AtomicU64
Hot path: total allocated bytes (8 bytes)
Implementations§
Source§impl SimpleMemoryStats
impl SimpleMemoryStats
Sourcepub fn record_allocation_fast(&self, size: u64)
pub fn record_allocation_fast(&self, size: u64)
Record allocation - fast path for hot operations
Sourcepub fn record_allocation_detailed(&self, size: u64)
pub fn record_allocation_detailed(&self, size: u64)
Record allocation with detailed tracking - slower path
Sourcepub fn record_deallocation(&self, size: u64)
pub fn record_deallocation(&self, size: u64)
Record deallocation
Sourcepub fn record_leak(&self, size: u64)
pub fn record_leak(&self, size: u64)
Record leaked allocation
Sourcepub fn snapshot(&self) -> MemoryStatsSnapshot
pub fn snapshot(&self) -> MemoryStatsSnapshot
Get snapshot of current statistics
Trait Implementations§
Source§impl Debug for SimpleMemoryStats
impl Debug for SimpleMemoryStats
Auto Trait Implementations§
impl !Freeze for SimpleMemoryStats
impl RefUnwindSafe for SimpleMemoryStats
impl Send for SimpleMemoryStats
impl Sync for SimpleMemoryStats
impl Unpin for SimpleMemoryStats
impl UnwindSafe for SimpleMemoryStats
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