pub struct MemoryManager { /* private fields */ }Expand description
Memory manager for tracking and optimizing memory usage
Implementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub fn new(options: MemoryOptions) -> Self
pub fn new(options: MemoryOptions) -> Self
Create a new memory manager
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get memory statistics
Sourcepub fn record_allocation(&self, bytes: usize)
pub fn record_allocation(&self, bytes: usize)
Record a memory allocation
Sourcepub fn record_cache_hit(&self)
pub fn record_cache_hit(&self)
Record a cache hit
Sourcepub fn record_cache_miss(&self)
pub fn record_cache_miss(&self)
Record a cache miss
Sourcepub fn cache(&self) -> Option<&ObjectCache>
pub fn cache(&self) -> Option<&ObjectCache>
Get the object cache
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl UnwindSafe for MemoryManager
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