Macro regex_automata::nfa::thompson::pikevm::instrument

source ·
macro_rules! instrument {
    ($fun:expr) => { ... };
}
Expand description

A simple macro for conditionally executing instrumentation logic when the ‘trace’ log level is enabled. This is a compile-time no-op when the ‘internal-instrument-pikevm’ feature isn’t enabled. The intent here is that this makes it easier to avoid doing extra work when instrumentation isn’t enabled.

This macro accepts a closure of type |&mut Counters|. The closure can then increment counters (or whatever) in accordance with what one wants to track.