pub struct AllocationTracker {
pub allocated_bytes: AtomicU64,
pub freed_bytes: AtomicU64,
pub allocation_count: AtomicU64,
pub deallocation_count: AtomicU64,
pub peak_bytes: AtomicU64,
/* private fields */
}Expand description
Allocation tracker for monitoring memory usage.
Fields§
§allocated_bytes: AtomicU64§freed_bytes: AtomicU64§allocation_count: AtomicU64§deallocation_count: AtomicU64§peak_bytes: AtomicU64Implementations§
Source§impl AllocationTracker
impl AllocationTracker
Sourcepub fn record_alloc(&self, size: usize)
pub fn record_alloc(&self, size: usize)
Record an allocation.
Sourcepub fn record_dealloc(&self, size: usize)
pub fn record_dealloc(&self, size: usize)
Record a deallocation.
Sourcepub fn live_bytes(&self) -> u64
pub fn live_bytes(&self) -> u64
Get current live bytes.
Sourcepub fn live_count(&self) -> u64
pub fn live_count(&self) -> u64
Get current live allocation count.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AllocationTracker
impl RefUnwindSafe for AllocationTracker
impl Send for AllocationTracker
impl Sync for AllocationTracker
impl Unpin for AllocationTracker
impl UnsafeUnpin for AllocationTracker
impl UnwindSafe for AllocationTracker
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