pub struct SparseMemoryManager;
Expand description
Global memory management functions
Implementations§
Source§impl SparseMemoryManager
impl SparseMemoryManager
Sourcepub fn allocate(
size: usize,
allocation_type: &str,
) -> TorshResult<SparseMemoryHandle>
pub fn allocate( size: usize, allocation_type: &str, ) -> TorshResult<SparseMemoryHandle>
Allocate memory using the global pool
Sourcepub fn global_statistics() -> MemoryStatistics
pub fn global_statistics() -> MemoryStatistics
Get global memory statistics
Sourcepub fn force_garbage_collect()
pub fn force_garbage_collect()
Force global garbage collection
Sourcepub fn is_healthy() -> bool
pub fn is_healthy() -> bool
Check if global memory pool is healthy
Sourcepub fn efficiency_score() -> f64
pub fn efficiency_score() -> f64
Get global memory efficiency score
Sourcepub fn configure(config: MemoryPoolConfig)
pub fn configure(config: MemoryPoolConfig)
Configure the global memory pool
Sourcepub fn generate_report() -> MemoryReport
pub fn generate_report() -> MemoryReport
Generate memory usage report
Auto Trait Implementations§
impl Freeze for SparseMemoryManager
impl RefUnwindSafe for SparseMemoryManager
impl Send for SparseMemoryManager
impl Sync for SparseMemoryManager
impl Unpin for SparseMemoryManager
impl UnwindSafe for SparseMemoryManager
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> 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