EventArgRecorder in rustc_data_structures::profiling - Rust (original) (raw)

Struct EventArgRecorder

Source

pub struct EventArgRecorder<'p> {
    profiler: &'p SelfProfiler,
    args: SmallVec<[StringId; 2]>,
}

Expand description

A helper for recording costly arguments to self-profiling events. Used withSelfProfilerRef::generic_activity_with_arg_recorder.

The SelfProfiler used to intern the event arguments that users will ask to record.

The interned event arguments to be recorded in the generic activity event.

The most common case, when actually recording event arguments, is to have one argument. Then followed by recording two, in a couple places.

Source§

Source

Records a single argument within the current generic activity being profiled.

Note: when self-profiling with costly event arguments, at least one argument needs to be recorded. A panic will be triggered if that doesn’t happen.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes