pub struct ScratchPool { /* private fields */ }Expand description
A named scratch pool for cross-frame temporary allocations.
Scratch pools are useful for memory that:
- Lives longer than a frame
- But is still scratch-like (bulk freed)
- Is associated with a subsystem or task
Implementations§
Source§impl ScratchPool
impl ScratchPool
Sourcepub fn alloc_layout(&mut self, layout: Layout) -> *mut u8
pub fn alloc_layout(&mut self, layout: Layout) -> *mut u8
Allocate with a specific layout.
Sourcepub fn alloc_slice<T>(&mut self, count: usize) -> *mut T
pub fn alloc_slice<T>(&mut self, count: usize) -> *mut T
Allocate a slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScratchPool
impl RefUnwindSafe for ScratchPool
impl !Send for ScratchPool
impl !Sync for ScratchPool
impl Unpin for ScratchPool
impl UnwindSafe for ScratchPool
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