Expand description
RAII guard returned by start() / start_with(); drops trigger exit export.
MemScopeGuard — the RAII handle returned by start() / start_with().
Holding the guard keeps tracking alive; dropping it triggers the idempotent
exit-path export (lifecycle::export_once). Combined with the panic hook,
ctrlc handler, and optional atexit registered by lifecycle::install, this
covers every realistic program-exit path.
§Module role
This is module 4 (the final module) of the auto-export feature. It ties modules 1-3 together into the user-facing API:
start/start_withinitialize logging, install the global tracker, wire the lifecycle hooks, and optionally spawn a background flusher.- The returned
MemScopeGuardowns the flusher handle and a clone of the trackerArc. ItsDropimpl joins the flusher (with a final flush) and then runs the idempotent exit-path export.
§Drop ordering
The flusher is dropped BEFORE the final export_once call so that the
flusher’s shutdown-time final flush is visible to the export latch. The
latch (lifecycle::EXPORTED) is set by whichever export runs first; the
second is a no-op, so there is no double-write.
Structs§
- MemScope
Guard - RAII handle that keeps the auto-export subsystem alive.
Functions§
- start
- Start memscope-rs with the default configuration.
- start_
with - Start memscope-rs with a custom configuration.