#[repr(C)]pub struct StdAllocator;
Available on crate feature
std_alloc
only.Expand description
Represents the default allocator taken from the standard Rust library.
Trait Implementations§
Source§impl Allocator for StdAllocator
impl Allocator for StdAllocator
type TAllocatedMemory = StdAllocatedMemory
Source§fn allocate(
&self,
layout: Layout,
) -> Result<Self::TAllocatedMemory, AllocationError>
fn allocate( &self, layout: Layout, ) -> Result<Self::TAllocatedMemory, AllocationError>
Allocates a new
AllocatedMemory
with the given layout. Read moreSource§unsafe fn convert_raw_ptr(&self, ptr: *mut u8) -> Self::TAllocatedMemory
unsafe fn convert_raw_ptr(&self, ptr: *mut u8) -> Self::TAllocatedMemory
Creates an
AllocatedMemory
from a raw pointer. Read moreSource§unsafe fn dangling<T>(&self) -> Self::TAllocatedMemory
unsafe fn dangling<T>(&self) -> Self::TAllocatedMemory
Creates a new dangling
AllocatedMemory
. This pointer
is non-zero, not valid but well-aligned. Note that it should
not be deallocated, nor dereferenced. It does however represent
a valid pointer to the type T
. Read moreSource§impl Clone for StdAllocator
impl Clone for StdAllocator
Source§fn clone(&self) -> StdAllocator
fn clone(&self) -> StdAllocator
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StdAllocator
impl Debug for StdAllocator
Source§impl Default for StdAllocator
impl Default for StdAllocator
Source§fn default() -> StdAllocator
fn default() -> StdAllocator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StdAllocator
impl RefUnwindSafe for StdAllocator
impl Send for StdAllocator
impl Sync for StdAllocator
impl Unpin for StdAllocator
impl UnwindSafe for StdAllocator
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