pub struct BumpAllocator<'a, M: BumpAllocatorArena = &'a [u8], H: Head = SingleThreadedHead> { /* private fields */ }Expand description
A generic bump allocator.
The bump allocator works on memory M, tracking where the remaining
free memory starts using head H.
Implementations§
Source§impl<'a> BumpAllocator<'a>
impl<'a> BumpAllocator<'a>
pub const fn with_slice(arena: &'a [u8]) -> SliceBumpAllocator<'a>
Source§impl<'a> BumpAllocator<'a, &'a [u8], ThreadSafeHead>
impl<'a> BumpAllocator<'a, &'a [u8], ThreadSafeHead>
pub const fn with_slice(arena: &'a [u8]) -> ThreadsafeSliceBumpAllocator<'a>
Source§impl<'a, M: BumpAllocatorArena, H: Head + Default> BumpAllocator<'a, M, H>
impl<'a, M: BumpAllocatorArena, H: Head + Default> BumpAllocator<'a, M, H>
Trait Implementations§
Source§impl<'a, M: BumpAllocatorArena, H: Head + Default> Debug for BumpAllocator<'a, M, H>
impl<'a, M: BumpAllocatorArena, H: Head + Default> Debug for BumpAllocator<'a, M, H>
Source§impl<'a, M: BumpAllocatorArena, H: Head + Default> GlobalAlloc for BumpAllocator<'a, M, H>
impl<'a, M: BumpAllocatorArena, H: Head + Default> GlobalAlloc for BumpAllocator<'a, M, H>
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreimpl<'a, M: BumpAllocatorArena, H: Head> Sync for BumpAllocator<'a, M, H>
Auto Trait Implementations§
impl<'a, M = &'a [u8], H = SingleThreadedHead> !Freeze for BumpAllocator<'a, M, H>
impl<'a, M = &'a [u8], H = SingleThreadedHead> !RefUnwindSafe for BumpAllocator<'a, M, H>
impl<'a, M, H> Send for BumpAllocator<'a, M, H>
impl<'a, M, H> Unpin for BumpAllocator<'a, M, H>
impl<'a, M, H> UnwindSafe for BumpAllocator<'a, M, H>where
M: UnwindSafe,
H: UnwindSafe,
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