Narrow RAII exemption that SUSPENDS the no-alloc contract on the current thread while alive, even when one or more ScopedNoAlloc guards are still on the stack.
More...
Narrow RAII exemption that SUSPENDS the no-alloc contract on the current thread while alive, even when one or more ScopedNoAlloc guards are still on the stack.
Use this only around a bounded operation that is known not to run on a real-time thread but calls code shared with a no-allocation path. Current examples are a subtree-cache miss record and an offscreen screenshot paint pass. Both legitimately allocate while preparing a one-shot result; neither is a live frame or audio callback. While an instance is alive, is_in_no_alloc_scope() reports false regardless of the ScopedNoAlloc depth, and nested ScopedNoAlloc guards remain suspended until the outer allowance ends.
Keep each allowance at the narrowest call-site scope so the contract snaps back immediately afterward. Like ScopedNoAlloc, the ctor/dtor symbols are always defined out-of-line and the body is a no-op under NDEBUG, so the ABI is identical across mixed-mode links.