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/events/Mark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/events/Mark.cpp') diff --git a/src/server/events/Mark.cpp b/src/server/events/Mark.cpp index 97acdbbb..87bc1035 100644 --- a/src/server/events/Mark.cpp +++ b/src/server/events/Mark.cpp @@ -84,7 +84,7 @@ Mark::pre_process(PreProcessContext& ctx) ctx.set_in_bundle(false); if (!ctx.dirty_graphs().empty()) { for (GraphImpl* g : ctx.dirty_graphs()) { - auto cg = compile(*_engine.maid(), *g); + auto cg = compile(*g); if (cg) { _compiled_graphs.emplace(g, std::move(cg)); } @@ -101,7 +101,7 @@ void Mark::execute(RunContext&) { for (auto& g : _compiled_graphs) { - g.first->set_compiled_graph(std::move(g.second)); + g.second = g.first->swap_compiled_graph(std::move(g.second)); } } -- cgit v1.2.1