pub struct DynamicAllocator<B: Backend> { /* private fields */ }
Expand description
No-fragmentation allocator. Suitable for any type of small allocations. Every freed block can be reused.
Implementations§
Source§impl<B> DynamicAllocator<B>where
B: Backend,
impl<B> DynamicAllocator<B>where
B: Backend,
Sourcepub fn new(
memory_type: MemoryTypeId,
memory_properties: Properties,
config: DynamicConfig,
) -> Self
pub fn new( memory_type: MemoryTypeId, memory_properties: Properties, config: DynamicConfig, ) -> Self
Create new DynamicAllocator
for memory_type
with memory_properties
specified,
with DynamicConfig
provided.
Sourcepub fn max_allocation(&self) -> u64
pub fn max_allocation(&self) -> u64
Maximum allocation size.
Trait Implementations§
Source§impl<B> Allocator<B> for DynamicAllocator<B>where
B: Backend,
impl<B> Allocator<B> for DynamicAllocator<B>where
B: Backend,
Source§type Block = DynamicBlock<B>
type Block = DynamicBlock<B>
Block type returned by allocator.
Source§fn alloc(
&mut self,
device: &B::Device,
size: u64,
align: u64,
) -> Result<(DynamicBlock<B>, u64), AllocationError>
fn alloc( &mut self, device: &B::Device, size: u64, align: u64, ) -> Result<(DynamicBlock<B>, u64), AllocationError>
Allocate block of memory.
On success returns allocated block and amount of memory consumed from device.
impl<B> Send for DynamicAllocator<B>where
B: Backend,
impl<B> Sync for DynamicAllocator<B>where
B: Backend,
Auto Trait Implementations§
impl<B> Freeze for DynamicAllocator<B>
impl<B> RefUnwindSafe for DynamicAllocator<B>
impl<B> Unpin for DynamicAllocator<B>
impl<B> UnwindSafe for DynamicAllocator<B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more