pub struct CountingAllocator;Expand description
Zero-sized global allocator delegating directly to System with a single-load disabled fast path.
Trait Implementations§
Source§impl Clone for CountingAllocator
impl Clone for CountingAllocator
impl Copy for CountingAllocator
Source§impl Debug for CountingAllocator
impl Debug for CountingAllocator
Source§impl Default for CountingAllocator
impl Default for CountingAllocator
Source§impl GlobalAlloc for CountingAllocator
Global allocator delegation with relaxed fast-path counting for CountingAllocator.
impl GlobalAlloc for CountingAllocator
Global allocator delegation with relaxed fast-path counting for CountingAllocator.
Source§unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates memory through the system allocator and records freed bytes when tracking is active.
§Arguments
&Self- Counting allocator reference.*mut u8- Pointer to previously allocated memory.Layout- Original allocation layout.
Source§unsafe fn realloc(
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize,
) -> *mut u8
unsafe fn realloc( &self, ptr: *mut u8, layout: Layout, new_size: usize, ) -> *mut u8
Reallocates memory through the system allocator and records byte deltas when tracking is active.
§Arguments
&Self- Counting allocator reference.*mut u8- Pointer to previously allocated memory.Layout- Previous allocation layout.usize- New requested byte size.
§Returns
*mut u8- Pointer to reallocated memory or null on failure.
Auto Trait Implementations§
impl Forget for CountingAllocator
impl Freeze for CountingAllocator
impl Move for CountingAllocator
impl RefUnwindSafe for CountingAllocator
impl Send for CountingAllocator
impl Sync for CountingAllocator
impl Unpin for CountingAllocator
impl UnsafeUnpin for CountingAllocator
impl UnwindSafe for CountingAllocator
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