pub struct MemoryPool { /* private fields */ }
Expand description
High-performance memory pool optimized for WASM
Implementations§
Source§impl MemoryPool
impl MemoryPool
Sourcepub fn with_config(config: PoolConfig) -> Self
pub fn with_config(config: PoolConfig) -> Self
Create a new memory pool with custom configuration
Sourcepub fn deallocate(&self, buffer: Vec<u8>)
pub fn deallocate(&self, buffer: Vec<u8>)
Return a buffer to the pool for reuse
Sourcepub fn total_pooled_memory(&self) -> usize
pub fn total_pooled_memory(&self) -> usize
Get total memory usage across all pools
Sourcepub fn shrink_to_fit(&self)
pub fn shrink_to_fit(&self)
Shrink pools to release unused memory
Trait Implementations§
Source§impl Debug for MemoryPool
impl Debug for MemoryPool
Auto Trait Implementations§
impl Freeze for MemoryPool
impl RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin for MemoryPool
impl UnwindSafe for MemoryPool
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