pub struct Global;Expand description
This represents the global allocator registered with the #[global_allocator] attribute
See GlobalAlloc for more info
Trait Implementations§
Source§impl Storage for Global
impl Storage for Global
Source§type Handle = GlobalHandle
type Handle = GlobalHandle
The
StorageHandle type that represents an allocation by this StorageSource§unsafe fn resolve(&self, handle: Self::Handle) -> NonNull<()>
unsafe fn resolve(&self, handle: Self::Handle) -> NonNull<()>
Returns a pointer to the allocation represented by
handle Read moreSource§fn allocate(
&self,
layout: Layout,
) -> Result<(Self::Handle, usize), StorageAllocError>
fn allocate( &self, layout: Layout, ) -> Result<(Self::Handle, usize), StorageAllocError>
Allocates memory with a layout specified by
layout Read moreSource§unsafe fn deallocate(&self, layout: Layout, handle: Self::Handle)
unsafe fn deallocate(&self, layout: Layout, handle: Self::Handle)
impl Copy for Global
impl MultipleStorage 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