Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::ScopedAllocAllowed Class Reference

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...

#include <scoped_no_alloc.hpp>

Public Member Functions

 ScopedAllocAllowed () noexcept
 ~ScopedAllocAllowed () noexcept
 ScopedAllocAllowed (const ScopedAllocAllowed &)=delete
ScopedAllocAllowed & operator= (const ScopedAllocAllowed &)=delete
 ScopedAllocAllowed (ScopedAllocAllowed &&)=delete
ScopedAllocAllowed & operator= (ScopedAllocAllowed &&)=delete

Detailed Description

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.

Constructor & Destructor Documentation

◆ ScopedAllocAllowed() [1/3]

pulp::runtime::ScopedAllocAllowed::ScopedAllocAllowed ( )
noexcept

◆ ~ScopedAllocAllowed()

pulp::runtime::ScopedAllocAllowed::~ScopedAllocAllowed ( )
noexcept

◆ ScopedAllocAllowed() [2/3]

pulp::runtime::ScopedAllocAllowed::ScopedAllocAllowed ( const ScopedAllocAllowed & )
delete

◆ ScopedAllocAllowed() [3/3]

pulp::runtime::ScopedAllocAllowed::ScopedAllocAllowed ( ScopedAllocAllowed && )
delete

Member Function Documentation

◆ operator=() [1/2]

ScopedAllocAllowed & pulp::runtime::ScopedAllocAllowed::operator= ( const ScopedAllocAllowed & )
delete

◆ operator=() [2/2]

ScopedAllocAllowed & pulp::runtime::ScopedAllocAllowed::operator= ( ScopedAllocAllowed && )
delete

The documentation for this class was generated from the following file: