Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
scoped_no_alloc.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace pulp::runtime {
4
28public:
29 // The ctor/dtor symbols are ALWAYS defined out-of-line so the
30 // ABI is identical whether Pulp was compiled with NDEBUG or not.
31 // Previously the header was guarded with `#ifdef NDEBUG` and the
32 // .cpp body was compiled out under NDEBUG, which broke any
33 // mixed-mode link (Release SDK + Debug downstream plugin emitted
34 // calls to symbols the Release archive didn't ship). The body of
35 // each ctor/dtor is conditional on NDEBUG inside scoped_no_alloc.cpp
36 // — the symbol exists in both modes but does nothing in Release.
37 ScopedNoAlloc() noexcept;
38 ~ScopedNoAlloc() noexcept;
39
40 ScopedNoAlloc(const ScopedNoAlloc&) = delete;
41 ScopedNoAlloc& operator=(const ScopedNoAlloc&) = delete;
43 ScopedNoAlloc& operator=(ScopedNoAlloc&&) = delete;
44};
45
64public:
66 ~ScopedAllocAllowed() noexcept;
67
69 ScopedAllocAllowed& operator=(const ScopedAllocAllowed&) = delete;
71 ScopedAllocAllowed& operator=(ScopedAllocAllowed&&) = delete;
72};
73
77bool is_in_no_alloc_scope() noexcept;
78
83int no_alloc_scope_depth() noexcept;
84
88
89} // namespace pulp::runtime
Definition generated_event_source.hpp:33
int no_alloc_scope_depth() noexcept
Depth of nested ScopedNoAlloc instances on the current thread.
bool is_in_no_alloc_scope() noexcept
int no_alloc_allowed_depth() noexcept
Depth of nested ScopedAllocAllowed instances on the current thread.