pub struct GlobalAllocator;
Expand description
A global allocator for our program.
Trait Implementations§
Source§impl Allocator for GlobalAllocator
impl Allocator for GlobalAllocator
fn allocate(&self, layout: Layout) -> Option<NonNull<u8>>
unsafe fn deallocate(&self, pointer: *mut u8, layout: Layout)
unsafe fn reallocate( &self, pointer: *mut u8, oldSize: usize, layout: Layout, ) -> Option<NonNull<u8>>
unsafe fn allocate_aligned(&self, layout: Layout) -> Option<NonNull<u8>>
unsafe fn deallocate_aligned(&self, pointer: *mut u8, layout: Layout)
Source§impl Clone for GlobalAllocator
impl Clone for GlobalAllocator
Source§fn clone(&self) -> GlobalAllocator
fn clone(&self) -> GlobalAllocator
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 GlobalAlloc for GlobalAllocator
impl GlobalAlloc for GlobalAllocator
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 moreimpl Copy for GlobalAllocator
Auto Trait Implementations§
impl Freeze for GlobalAllocator
impl RefUnwindSafe for GlobalAllocator
impl Send for GlobalAllocator
impl Sync for GlobalAllocator
impl Unpin for GlobalAllocator
impl UnwindSafe for GlobalAllocator
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