pub trait Allocator: Send + Sync {
// Required methods
fn allocate(&self, size: usize, alignment: usize) -> Result<NonNull<u8>>;
fn deallocate(&self, ptr: NonNull<u8>, size: usize) -> Result<()>;
fn stats(&self) -> Arc<AllocatorStats>;
}Expand description
Generic allocator trait
Required Methods§
Sourcefn stats(&self) -> Arc<AllocatorStats>
fn stats(&self) -> Arc<AllocatorStats>
Get statistics