pub struct FreeOnlyAllocator { /* private fields */ }Implementations§
Source§impl FreeOnlyAllocator
impl FreeOnlyAllocator
Sourcepub fn join(file: &File) -> Result<Self, Error>
pub fn join(file: &File) -> Result<Self, Error>
Join an existing allocator in the provided file.
§Note
Prefer Self::join_from_existing to re-use mmaps within the same
process.
Sourcepub fn join_from_existing(existing: &Allocator) -> Self
pub fn join_from_existing(existing: &Allocator) -> Self
Join an existing allocator using the same in-process mapping.
Sourcepub fn join_from_existing_free_only(existing: &FreeOnlyAllocator) -> Self
pub fn join_from_existing_free_only(existing: &FreeOnlyAllocator) -> Self
Join an existing free-only allocator using the same in-process mapping.
Source§impl FreeOnlyAllocator
impl FreeOnlyAllocator
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 free_offset(&self, offset: usize)
pub unsafe fn free_offset(&self, offset: usize)
Free a block of memory previously allocated by this allocator.
§Safety
- The
offsetmust be a valid offset within the memory allocated by this allocator. - The
offsetmust not have been freed before.
Trait Implementations§
impl Send for FreeOnlyAllocator
Auto Trait Implementations§
impl Freeze for FreeOnlyAllocator
impl RefUnwindSafe for FreeOnlyAllocator
impl Sync for FreeOnlyAllocator
impl Unpin for FreeOnlyAllocator
impl UnsafeUnpin for FreeOnlyAllocator
impl UnwindSafe for FreeOnlyAllocator
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