pub struct Arena<const N: usize> { /* private fields */ }Expand description
Arena allocator for temporary allocations
Fast allocator for temporary objects that will all be freed together
Implementations§
Source§impl<const N: usize> Arena<N>
impl<const N: usize> Arena<N>
Sourcepub fn allocate_typed<T>(&self) -> Result<NonNull<T>>
pub fn allocate_typed<T>(&self) -> Result<NonNull<T>>
Allocate a typed value
Returns a NonNull<T> pointer to properly aligned, uninitialized memory.
The caller is responsible for initializing the memory before use.
§Errors
Returns error if insufficient space
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> !Freeze for Arena<N>
impl<const N: usize> !RefUnwindSafe for Arena<N>
impl<const N: usize> Send for Arena<N>
impl<const N: usize> !Sync for Arena<N>
impl<const N: usize> Unpin for Arena<N>
impl<const N: usize> UnsafeUnpin for Arena<N>
impl<const N: usize> UnwindSafe for Arena<N>
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