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/CompiledGraph.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/server/CompiledGraph.hpp') diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index a5ba66c3..89aab289 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -19,7 +19,6 @@ #include "Task.hpp" -#include "raul/Maid.hpp" #include "raul/Noncopyable.hpp" #include @@ -39,17 +38,14 @@ class RunContext; * execute the nodes in order and have nodes always executed before any of * their dependencies. */ -class CompiledGraph : public raul::Maid::Disposable - , public raul::Noncopyable +class CompiledGraph : public raul::Noncopyable { public: - static raul::managed_ptr compile(raul::Maid& maid, GraphImpl& graph); + static std::unique_ptr compile(GraphImpl& graph); void run(RunContext& ctx); private: - friend class raul::Maid; ///< Allow make_managed to construct - CompiledGraph(GraphImpl* graph); using BlockSet = std::set; @@ -72,10 +68,10 @@ private: std::unique_ptr _master; }; -inline raul::managed_ptr -compile(raul::Maid& maid, GraphImpl& graph) +inline std::unique_ptr +compile(GraphImpl& graph) { - return CompiledGraph::compile(maid, graph); + return CompiledGraph::compile(graph); } } // namespace ingen::server -- cgit v1.2.1