summaryrefslogtreecommitdiffstats
path: root/src/server/CompiledGraph.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-22 11:13:12 -0400
committerDavid Robillard <d@drobilla.net>2023-09-22 11:27:06 -0400
commit97f5ecf41bccbc6339a18c649cd7bfcd84b18312 (patch)
treeae717b716d76d30846ad1d8eb46967866ab6a140 /src/server/CompiledGraph.hpp
parent3192ce81f9f87e4e56393dd539c95185c7ef306d (diff)
downloadingen-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/CompiledGraph.hpp')
-rw-r--r--src/server/CompiledGraph.hpp14
1 files changed, 5 insertions, 9 deletions
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 <cstddef>
@@ -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<CompiledGraph> compile(raul::Maid& maid, GraphImpl& graph);
+ static std::unique_ptr<CompiledGraph> compile(GraphImpl& graph);
void run(RunContext& ctx);
private:
- friend class raul::Maid; ///< Allow make_managed to construct
-
CompiledGraph(GraphImpl* graph);
using BlockSet = std::set<BlockImpl*>;
@@ -72,10 +68,10 @@ private:
std::unique_ptr<Task> _master;
};
-inline raul::managed_ptr<CompiledGraph>
-compile(raul::Maid& maid, GraphImpl& graph)
+inline std::unique_ptr<CompiledGraph>
+compile(GraphImpl& graph)
{
- return CompiledGraph::compile(maid, graph);
+ return CompiledGraph::compile(graph);
}
} // namespace ingen::server