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