From 97f5ecf41bccbc6339a18c649cd7bfcd84b18312 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 22 Sep 2023 11:13:12 -0400 Subject: 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. --- src/server/PreProcessContext.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/server/PreProcessContext.hpp') 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 #include 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 - maybe_compile(raul::Maid& maid, GraphImpl& graph) + [[nodiscard]] std::unique_ptr 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. */ -- cgit v1.2.1