pub struct Global;Expand description
This is basically a wrapper around the std global allocator APIs.
See: https://doc.rust-lang.org/std/alloc/struct.Global.html
It has the same name as Global since the allocator APIs are
not stabilized yet. When stabilized this will be just removed.
Rust’s Global will be exported for backwards compatibility.
Trait Implementations§
Source§impl AltAllocator for Global
impl AltAllocator for Global
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Allocates a chunk of memory with the given layout. Read more
Source§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Allocates just like
allocate but also zeroes the memory.Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
Deallocates the chunk of memory pointed at by
ptr Read moreSource§unsafe fn grow(
&self,
old_ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, old_ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Grows the memory pointed at by
old_ptr to the new layout. Read moreimpl Copy for Global
Auto Trait Implementations§
impl Freeze for Global
impl RefUnwindSafe for Global
impl Send for Global
impl Sync for Global
impl Unpin for Global
impl UnwindSafe for Global
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