pub struct GeneralAllocator<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: Backend> GeneralAllocator<B>
impl<B: Backend> GeneralAllocator<B>
Sourcepub fn new(
memory_type: MemoryTypeId,
memory_properties: Properties,
config: GeneralConfig,
non_coherent_atom_size: Size,
) -> Self
pub fn new( memory_type: MemoryTypeId, memory_properties: Properties, config: GeneralConfig, non_coherent_atom_size: Size, ) -> Self
Create new GeneralAllocator
for memory_type
with memory_properties
specified,
with GeneralConfig
provided.
Sourcepub fn max_sub_block_size(&self) -> Size
pub fn max_sub_block_size(&self) -> Size
Maximum block size to allocate within a chunk that is another block.
Trait Implementations§
Source§impl<B: Backend> Allocator<B> for GeneralAllocator<B>
impl<B: Backend> Allocator<B> for GeneralAllocator<B>
Source§type Block = GeneralBlock<B>
type Block = GeneralBlock<B>
Block type returned by allocator.
Source§fn alloc(
&mut self,
device: &B::Device,
size: Size,
align: Size,
) -> Result<(GeneralBlock<B>, Size), AllocationError>
fn alloc( &mut self, device: &B::Device, size: Size, align: Size, ) -> Result<(GeneralBlock<B>, Size), AllocationError>
Allocate block of memory.
On success returns allocated block and amount of memory consumed from device.
Source§impl<B: Backend> Drop for GeneralAllocator<B>
impl<B: Backend> Drop for GeneralAllocator<B>
impl<B: Backend> Send for GeneralAllocator<B>
impl<B: Backend> Sync for GeneralAllocator<B>
Auto Trait Implementations§
impl<B> Freeze for GeneralAllocator<B>
impl<B> RefUnwindSafe for GeneralAllocator<B>
impl<B> Unpin for GeneralAllocator<B>
impl<B> UnwindSafe for GeneralAllocator<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