pub struct SampledAllocator<A> { /* private fields */ }Expand description
GlobalAlloc wrapper that routes each alloc/dealloc through
libdd-profiling-heap-sampler before forwarding to the inner allocator A.
The default realloc / alloc_zeroed impls from GlobalAlloc are
inherited; they dispatch back to alloc / dealloc, so sampling
still fires for those paths.
On non-Linux targets the sampler integration is a no-op and this is
just a transparent forwarder to inner; callers can use the same
#[global_allocator] setup unconditionally.
Implementations§
Source§impl<A> SampledAllocator<A>
impl<A> SampledAllocator<A>
Trait Implementations§
Source§impl<A: GlobalAlloc> GlobalAlloc for SampledAllocator<A>
impl<A: GlobalAlloc> GlobalAlloc for SampledAllocator<A>
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 moreAuto Trait Implementations§
impl<A> Freeze for SampledAllocator<A>where
A: Freeze,
impl<A> RefUnwindSafe for SampledAllocator<A>where
A: RefUnwindSafe,
impl<A> Send for SampledAllocator<A>where
A: Send,
impl<A> Sync for SampledAllocator<A>where
A: Sync,
impl<A> Unpin for SampledAllocator<A>where
A: Unpin,
impl<A> UnsafeUnpin for SampledAllocator<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for SampledAllocator<A>where
A: UnwindSafe,
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