pub struct BumpAllocator {
pub start: usize,
pub len: usize,
}
Fields§
§start: usize
§len: usize
Implementations§
Source§impl BumpAllocator
impl BumpAllocator
Sourcepub unsafe fn pos(&self) -> usize
pub unsafe fn pos(&self) -> usize
Returns the current position of the heap.
§Safety
This function is unsafe because it returns a raw pointer.
Sourcepub unsafe fn move_cursor(&self, pos: usize)
pub unsafe fn move_cursor(&self, pos: usize)
Reset heap start cursor to position.
§Safety
Do not use this function if you initialized heap memory after pos which you still need.
Trait Implementations§
Source§impl GlobalAlloc for BumpAllocator
impl GlobalAlloc for BumpAllocator
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 moreAuto Trait Implementations§
impl Freeze for BumpAllocator
impl RefUnwindSafe for BumpAllocator
impl Send for BumpAllocator
impl Sync for BumpAllocator
impl Unpin for BumpAllocator
impl UnwindSafe for BumpAllocator
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