pub struct Alloc;Expand description
A global allocator that tracks allocations and deallocations on behalf of
the Profiler type.
It must be set as the global allocator (via #[global_allocator]) when
doing heap profiling.
Trait Implementations§
Source§impl GlobalAlloc for Alloc
impl GlobalAlloc for Alloc
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreSource§unsafe fn realloc(
&self,
old_ptr: *mut u8,
layout: Layout,
new_size: usize,
) -> *mut u8
unsafe fn realloc( &self, old_ptr: *mut u8, layout: Layout, new_size: usize, ) -> *mut u8
Shrinks or grows a block of memory to the given
new_size in bytes.
The block is described by the given ptr pointer and layout. Read moreAuto Trait Implementations§
impl Freeze for Alloc
impl RefUnwindSafe for Alloc
impl Send for Alloc
impl Sync for Alloc
impl Unpin for Alloc
impl UnwindSafe for Alloc
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