pub struct Allocator { /* private fields */ }Implementations§
Source§impl Allocator
impl Allocator
Source§impl Allocator
impl Allocator
Sourcepub unsafe fn free(&self, ptr: NonNull<u8>)
pub unsafe fn free(&self, ptr: NonNull<u8>)
Free a block of memory previously allocated by this allocator.
§Safety
- The
ptrmust be a valid pointer to a block of memory allocated by this allocator. - The
ptrmust not have been freed before.
Sourcepub unsafe fn offset(&self, ptr: NonNull<u8>) -> usize
pub unsafe fn offset(&self, ptr: NonNull<u8>) -> usize
Find the offset given a pointer.
§Safety
- The
ptrmust be a valid pointer in the allocator’s address space.
Sourcepub fn ptr_from_offset(&self, offset: usize) -> NonNull<u8>
pub fn ptr_from_offset(&self, offset: usize) -> NonNull<u8>
Return a ptr given a shareable offset - calculated by offset.
Source§impl Allocator
impl Allocator
Sourcepub fn clean_remote_free_lists(&self)
pub fn clean_remote_free_lists(&self)
Frees all items in remote free lists.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Allocator
impl RefUnwindSafe for Allocator
impl !Send for Allocator
impl !Sync for Allocator
impl Unpin for Allocator
impl UnwindSafe for Allocator
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