Skip to main content

log_arrangement_size_inner

Function log_arrangement_size_inner 

Source
fn log_arrangement_size_inner<'scope, B, L>(
    arranged: Arranged<'scope, TraceAgent<Spine<ArcBatch<B>>>>,
    logic: L,
) -> Arranged<'scope, TraceAgent<Spine<ArcBatch<B>>>>
where B: Batch + 'static, L: FnMut(&B) -> (usize, usize, usize) + 'static,
Expand description

Helper for ArrangementSize to install a common operator holding on to a trace.

  • arranged: The arrangement to inspect.
  • logic: Closure that calculates the heap size/capacity/allocations for a batch. The return value are size and capacity in bytes, and number of allocations, all in absolute values.

Batch-size logging identifies each batch by the address of its backing allocation and holds a weak reference to it, so it needs the Arc underlying the spine’s ArcBatch<B> batches; batch.0 reaches straight through the newtype to it.