pub struct DefaultAlloc;Expand description
Default allocator, delegating to the global allocator.
Trait Implementations§
Source§impl Alloc for DefaultAlloc
impl Alloc for DefaultAlloc
Source§impl Allocator for DefaultAlloc
impl Allocator for DefaultAlloc
Source§fn allocate(&self, layout: StdLayout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: StdLayout) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to allocate a block of memory. Read more
Source§fn allocate_zeroed(
&self,
layout: StdLayout,
) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed( &self, layout: StdLayout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read moreSource§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: StdLayout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: StdLayout)
🔬This is a nightly-only experimental API. (
allocator_api)Deallocates the memory referenced by
ptr. Read moreSource§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: StdLayout,
new_layout: StdLayout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: StdLayout, new_layout: StdLayout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Attempts to extend the memory block. Read more
Source§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: StdLayout,
new_layout: StdLayout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: StdLayout, new_layout: StdLayout, ) -> Result<NonNull<[u8]>, AllocError>
🔬This is a nightly-only experimental API. (
allocator_api)Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§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 Dealloc for DefaultAlloc
impl Dealloc for DefaultAlloc
Source§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: StdLayout) -> *mut u8
unsafe fn alloc(&self, layout: StdLayout) -> *mut u8
Allocates memory as described by the given
layout. Read moreSource§impl Grow for DefaultAlloc
impl Grow for DefaultAlloc
Source§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
Source§impl Realloc for DefaultAlloc
impl Realloc for DefaultAlloc
Source§impl Shrink for DefaultAlloc
impl Shrink 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