Struct vk_alloc::LinearAllocator[][src]

pub struct LinearAllocator { /* fields omitted */ }
👎 Deprecated since 0.2.0:

This allocator isn’t really useful. A linear allocator is more useful when implemented by the application directly.

A linear memory allocator.

Memory is allocated by simply allocating new memory at the end of an allocated memory block. The whole memory has to be freed at once. Needs to be created for a specific memory location. Heap can only grow as the initially specified block size.

Implementations

impl LinearAllocator[src]

pub fn new(
    instance: &Instance,
    physical_device: PhysicalDevice,
    logical_device: &Device,
    descriptor: &LinearAllocatorDescriptor
) -> Result<Self, AllocatorError>
[src]

Creates a new linear allocator.

pub fn allocate(
    &mut self,
    descriptor: &LinearAllocationDescriptor
) -> Result<LinearAllocation, AllocatorError>
[src]

Allocates some memory on the linear allocator.

Memory location and requirements have to be defined at the creation of the linear allocator. If the allocator has not enough space left for the allocation, it will fail with an OutOfMemory error.

pub fn free(&mut self)[src]

Resets the end of the heap back to the start of the memory allocation.

All previously Allocation will get invalid after this. Accessing them afterward is undefined behavior.

Trait Implementations

impl AllocatorStatistic for LinearAllocator[src]

impl Drop for LinearAllocator[src]

Auto Trait Implementations

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.