vector/internal_telemetry/allocations/allocator/
mod.rs

1use self::token::with_suspended_allocation_group;
2mod stack;
3mod token;
4mod tracer;
5mod tracing;
6mod tracing_allocator;
7
8pub use self::token::AllocationGroupId;
9pub use self::token::AllocationGroupToken;
10pub use self::tracer::Tracer;
11pub use self::tracing::AllocationLayer;
12pub use self::tracing_allocator::GroupedTraceableAllocator;
13
14/// Runs the given closure without tracing allocations or deallocations.
15///
16/// Inevitably, memory may need to be allocated and deallocated in the area of the program that's
17/// aggregating and processing the allocator events. While `GroupedTraceableAllocator` already
18/// avoids reentrantly tracing (de)allocations, this method provides a way to do so from _outside_
19/// of the `GlobalAlloc` codepath.
20#[inline(always)]
21pub fn without_allocation_tracing<F>(f: F)
22where
23    F: FnOnce(),
24{
25    with_suspended_allocation_group(f)
26}