pub struct DefaultAlloc;Expand description
Default allocator, delegating to the global allocator.
Trait Implementations§
Source§impl Alloc for DefaultAlloc
impl Alloc for DefaultAlloc
Source§unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates a previously allocated block. Read more
Source§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>
Grow the given block to a new, larger layout. Read more
Source§unsafe fn zgrow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<u8>, AllocError>
unsafe fn zgrow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<u8>, AllocError>
Grows the given block to a new, larger layout, zeroing any newly allocated bytes. Read more
Source§unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<u8>, AllocError>
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<u8>, AllocError>
Shrink the given block to a new, smaller layout. Read more
Source§impl Clone for DefaultAlloc
impl Clone for DefaultAlloc
Source§fn clone(&self) -> DefaultAlloc
fn clone(&self) -> DefaultAlloc
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultAlloc
impl Debug for DefaultAlloc
Source§impl Default for DefaultAlloc
impl Default for DefaultAlloc
Source§fn default() -> DefaultAlloc
fn default() -> DefaultAlloc
Returns the “default value” for a type. Read more
Source§impl GlobalAlloc for DefaultAlloc
impl GlobalAlloc for DefaultAlloc
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 moreSource§impl Hash for DefaultAlloc
impl Hash for DefaultAlloc
Source§impl Ord for DefaultAlloc
impl Ord for DefaultAlloc
Source§fn cmp(&self, other: &DefaultAlloc) -> Ordering
fn cmp(&self, other: &DefaultAlloc) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DefaultAlloc
impl PartialEq for DefaultAlloc
Source§impl PartialOrd for DefaultAlloc
impl PartialOrd for DefaultAlloc
impl Copy for DefaultAlloc
impl Eq for DefaultAlloc
impl StructuralPartialEq for DefaultAlloc
Auto Trait Implementations§
impl Freeze for DefaultAlloc
impl RefUnwindSafe for DefaultAlloc
impl Send for DefaultAlloc
impl Sync for DefaultAlloc
impl Unpin for DefaultAlloc
impl UnwindSafe for DefaultAlloc
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