Struct gpu_alloc::buddy::BuddyAllocator
source · pub(crate) struct BuddyAllocator<M> {
minimal_size: u64,
chunks: Slab<Chunk<M>>,
sizes: Vec<Size>,
memory_type: u32,
props: MemoryPropertyFlags,
atom_mask: u64,
}
Fields§
§minimal_size: u64
§chunks: Slab<Chunk<M>>
§sizes: Vec<Size>
§memory_type: u32
§props: MemoryPropertyFlags
§atom_mask: u64
Implementations§
source§impl<M> BuddyAllocator<M>where
M: MemoryBounds + 'static,
impl<M> BuddyAllocator<M>where
M: MemoryBounds + 'static,
pub fn new( minimal_size: u64, initial_dedicated_size: u64, memory_type: u32, props: MemoryPropertyFlags, atom_mask: u64, ) -> Self
pub unsafe fn alloc( &mut self, device: &impl MemoryDevice<M>, size: u64, align_mask: u64, flags: AllocationFlags, heap: &mut Heap, allocations_remains: &mut u32, ) -> Result<BuddyBlock<M>, AllocationError>
pub unsafe fn dealloc( &mut self, device: &impl MemoryDevice<M>, block: BuddyBlock<M>, heap: &mut Heap, allocations_remains: &mut u32, )
fn host_visible(&self) -> bool
Trait Implementations§
source§impl<M: Debug> Debug for BuddyAllocator<M>
impl<M: Debug> Debug for BuddyAllocator<M>
impl<M> Send for BuddyAllocator<M>where
M: Send,
impl<M> Sync for BuddyAllocator<M>where
M: Sync,
Auto Trait Implementations§
impl<M> Freeze for BuddyAllocator<M>
impl<M> RefUnwindSafe for BuddyAllocator<M>where
M: RefUnwindSafe,
impl<M> Unpin for BuddyAllocator<M>
impl<M> UnwindSafe for BuddyAllocator<M>where
M: RefUnwindSafe,
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