[][src]Struct gfx_memory::Heaps

pub struct Heaps<B: Backend> { /* fields omitted */ }

Heaps available on particular physical device.

Implementations

impl<B: Backend> Heaps<B>[src]

pub unsafe fn new(
    hal_memory_properties: &MemoryProperties,
    config_general: GeneralConfig,
    config_linear: LinearConfig,
    non_coherent_atom_size: Size
) -> Self
[src]

Initialize the new Heaps object.

Safety

All later operations assume the device is not lost.

pub fn allocate(
    &mut self,
    device: &B::Device,
    requirements: &Requirements,
    usage: MemoryUsage,
    kind: Kind
) -> Result<MemoryBlock<B>, HeapsError>
[src]

Allocate memory block give the requirements from gfx-hal. for intended usage, using the kind of allocator.

pub fn free(&mut self, device: &B::Device, block: MemoryBlock<B>)[src]

Free memory block.

Memory block must be allocated from this heap.

pub fn clear(&mut self, device: &B::Device)[src]

Clear allocators. Call this before dropping an instance of Heaps or if you are low on memory.

Internally calls the clear methods on all internal LinearAllocator and GeneralAllocator instances.

pub fn utilization(&self) -> TotalMemoryUtilization[src]

Get memory utilization.

Trait Implementations

impl<B: Debug + Backend> Debug for Heaps<B>[src]

impl<B: Backend> Drop for Heaps<B>[src]

Auto Trait Implementations

impl<B> RefUnwindSafe for Heaps<B> where
    <B as Backend>::Memory: RefUnwindSafe

impl<B> Send for Heaps<B>

impl<B> Sync for Heaps<B>

impl<B> Unpin for Heaps<B>

impl<B> UnwindSafe for Heaps<B> where
    <B as Backend>::Memory: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.