pub struct Perm;Expand description
Perm Allocator.
Implementations§
Trait Implementations§
Source§impl Allocator for Perm
impl Allocator for Perm
Source§fn allocate(&self, lay: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, lay: Layout) -> Result<NonNull<[u8]>, AllocError>
Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, p: NonNull<u8>, lay: Layout)
unsafe fn deallocate(&self, p: NonNull<u8>, lay: Layout)
Deallocates the memory referenced by
ptr. Read moreSource§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§impl GlobalAlloc for Perm
impl GlobalAlloc for Perm
Source§unsafe fn alloc(&self, lay: Layout) -> *mut u8
unsafe fn alloc(&self, lay: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreAuto Trait Implementations§
impl Freeze for Perm
impl RefUnwindSafe for Perm
impl Send for Perm
impl Sync for Perm
impl Unpin for Perm
impl UnsafeUnpin for Perm
impl UnwindSafe for Perm
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