pub trait MemoryPool: Send + Sync {
// Required methods
fn kind(&self) -> MemoryKind;
fn alloc(&self, bytes: usize, align: usize) -> Result<Box<dyn Allocation>>;
// Provided method
fn trim(&self) { ... }
}Expand description
Pluggable allocator. Concrete backends register one default pool per device (e.g. CUDA stream-ordered async allocator) plus optional pools for pinned / unified memory.
Required Methods§
fn kind(&self) -> MemoryKind
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".