Struct ccthw_ash_allocator::DedicatedAllocator
source · pub struct DedicatedAllocator<A: ComposableAllocator, B: ComposableAllocator> { /* private fields */ }
Expand description
An allocator which correctly handles allocations which prefer or require dedicated allocations.
Implementations§
source§impl<A, B> DedicatedAllocator<A, B>where
A: ComposableAllocator,
B: ComposableAllocator,
impl<A, B> DedicatedAllocator<A, B>where A: ComposableAllocator, B: ComposableAllocator,
sourcepub fn new(allocator: A, device_allocator: B) -> Self
pub fn new(allocator: A, device_allocator: B) -> Self
Create a new dedicated allocator which decorates another allocator implementation to properly handle dedicated resources.
Param
- allocator: The allocator to decorate.
- device_allocator: An allocator which directly returns memory from the device itself.
Trait Implementations§
source§impl<A, B> ComposableAllocator for DedicatedAllocator<A, B>where
A: ComposableAllocator,
B: ComposableAllocator,
impl<A, B> ComposableAllocator for DedicatedAllocator<A, B>where A: ComposableAllocator, B: ComposableAllocator,
source§unsafe fn allocate(
&mut self,
allocation_requirements: AllocationRequirements
) -> Result<Allocation, AllocatorError>
unsafe fn allocate( &mut self, allocation_requirements: AllocationRequirements ) -> Result<Allocation, AllocatorError>
Allocate GPU memory based on the given requirements. Read more
source§unsafe fn free(&mut self, allocation: Allocation)
unsafe fn free(&mut self, allocation: Allocation)
Return a GPU memory allocation to the device. Read more