Skip to content
fn

set_current_profiler

void set_current_profiler(Profiler * p)

Registers p as the active Profiler for the calling thread.

See Also

current_profiler — reader for the same TLS slot.

Parameters

Profiler to register, or nullptr to deactivate profiling on this thread without destroying the existing object.

Notes

Does not transfer ownership — the caller must keep p alive for as long as any OpScope could observe it as the current profiler. The Python wrapper holds the binding object's shared_ptr for exactly this reason.