Allocator

Trait Allocator 

Source
pub trait Allocator:
    Clone
    + Send
    + Sync {
    type Allocation: Allocation;
    type AllocationCreateInfo: AllocationCreateInfo;

    // Required methods
    fn allocate(
        &self,
        desc: Self::AllocationCreateInfo,
    ) -> Result<Self::Allocation>;
    fn free(&self, allocation: Self::Allocation) -> Result<()>;
}
Expand description

trait for GPU memory allocator.

Required Associated Types§

Required Methods§

Source

fn allocate(&self, desc: Self::AllocationCreateInfo) -> Result<Self::Allocation>

Allocate a new memory region.

Source

fn free(&self, allocation: Self::Allocation) -> Result<()>

Free a memory region.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§