pub struct MemoryStatsRegistry {
pub overflow_count: AtomicU64,
/* private fields */
}Expand description
Global registry for cross-thread memory statistics
Fields§
§overflow_count: AtomicU64Count of threads that couldn’t get a slot
Implementations§
Source§impl MemoryStatsRegistry
impl MemoryStatsRegistry
Sourcepub fn register(&self) -> Option<usize>
pub fn register(&self) -> Option<usize>
Register a thread and get its slot index
Returns Some(index) if a slot was claimed, None if registry is full. Uses the current thread’s ID as the identifier.
Sourcepub fn update_arena(&self, slot_idx: usize, arena_bytes: usize)
pub fn update_arena(&self, slot_idx: usize, arena_bytes: usize)
Sourcepub fn update_pool(&self, slot_idx: usize, free_count: usize, capacity: usize)
pub fn update_pool(&self, slot_idx: usize, free_count: usize, capacity: usize)
Sourcepub fn increment_pool_allocations(&self, slot_idx: usize)
pub fn increment_pool_allocations(&self, slot_idx: usize)
Increment pool allocation counter
Sourcepub fn aggregate_stats(&self) -> AggregateMemoryStats
pub fn aggregate_stats(&self) -> AggregateMemoryStats
Get aggregated memory statistics across all threads
Sourcepub fn per_thread_stats(&self) -> impl Iterator<Item = ThreadMemoryStats> + '_
pub fn per_thread_stats(&self) -> impl Iterator<Item = ThreadMemoryStats> + '_
Iterate over per-thread statistics (for detailed diagnostics)
Auto Trait Implementations§
impl !Freeze for MemoryStatsRegistry
impl RefUnwindSafe for MemoryStatsRegistry
impl Send for MemoryStatsRegistry
impl Sync for MemoryStatsRegistry
impl Unpin for MemoryStatsRegistry
impl UnwindSafe for MemoryStatsRegistry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more