diff options
author | David Robillard <d@drobilla.net> | 2023-09-22 11:13:12 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-09-22 11:27:06 -0400 |
commit | 97f5ecf41bccbc6339a18c649cd7bfcd84b18312 (patch) | |
tree | ae717b716d76d30846ad1d8eb46967866ab6a140 /src/server/PreProcessContext.hpp | |
parent | 3192ce81f9f87e4e56393dd539c95185c7ef306d (diff) | |
download | ingen-97f5ecf41bccbc6339a18c649cd7bfcd84b18312.tar.gz ingen-97f5ecf41bccbc6339a18c649cd7bfcd84b18312.tar.bz2 ingen-97f5ecf41bccbc6339a18c649cd7bfcd84b18312.zip |
Use a regular unique_ptr for compiled graphs
Since these are always swapped by events which already have the ability to
delete things after execution (by deleting them along with the event itself
after processing), we can avoid the complexity and overhead of
Raul::managed_ptr here by swapping the old graph for the new, retaining the
owning reference to the old CompiledGraph in the event.
Diffstat (limited to 'src/server/PreProcessContext.hpp')
-rw-r--r-- | src/server/PreProcessContext.hpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/server/PreProcessContext.hpp b/src/server/PreProcessContext.hpp index 79e8ca68..7c97af3c 100644 --- a/src/server/PreProcessContext.hpp +++ b/src/server/PreProcessContext.hpp @@ -20,8 +20,7 @@ #include "CompiledGraph.hpp" #include "GraphImpl.hpp" -#include "raul/Maid.hpp" - +#include <memory> #include <unordered_set> namespace ingen::server { @@ -64,13 +63,9 @@ public: * This may return null when an atomic bundle is deferring compilation, in * which case the graph is flagged as dirty for later compilation. */ - raul::Maid::managed_ptr<CompiledGraph> - maybe_compile(raul::Maid& maid, GraphImpl& graph) + [[nodiscard]] std::unique_ptr<CompiledGraph> maybe_compile(GraphImpl& graph) { - if (must_compile(graph)) { - return compile(maid, graph); - } - return nullptr; + return must_compile(graph) ? compile(graph) : nullptr; } /** Return all graphs that require compilation after an atomic bundle. */ |