[][src]Trait amethyst_rendy::rendy::memory::Allocator

pub trait Allocator<B> where
    B: Backend
{ type Block: Block<B>; fn kind() -> Kind;
fn alloc(
        &mut self,
        device: &<B as Backend>::Device,
        size: u64,
        align: u64
    ) -> Result<(Self::Block, u64), AllocationError>;
fn free(
        &mut self,
        device: &<B as Backend>::Device,
        block: Self::Block
    ) -> u64; }

Allocator trait implemented for various allocators.

Associated Types

type Block: Block<B>

Block type returned by allocator.

Loading content...

Required methods

fn kind() -> Kind

Get allocator kind.

fn alloc(
    &mut self,
    device: &<B as Backend>::Device,
    size: u64,
    align: u64
) -> Result<(Self::Block, u64), AllocationError>

Allocate block of memory. On success returns allocated block and amount of memory consumed from device.

fn free(&mut self, device: &<B as Backend>::Device, block: Self::Block) -> u64

Free block of memory. Returns amount of memory returned to the device.

Loading content...

Implementors

impl<B> Allocator<B> for DedicatedAllocator where
    B: Backend
[src]

type Block = DedicatedBlock<B>

impl<B> Allocator<B> for DynamicAllocator<B> where
    B: Backend
[src]

type Block = DynamicBlock<B>

impl<B> Allocator<B> for LinearAllocator<B> where
    B: Backend
[src]

type Block = LinearBlock<B>

Loading content...