From ccc2a7996b836cd255fbb7d7f693f5b958442043 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 20 Jul 2020 16:00:20 +0200 Subject: BLI: add typedefs for containers that use raw allocators Those are useful when you have to create containers with static storage duration. If those would use Blender's guarded allocator, it would report memory leaks, that are not actually leaks. --- source/blender/depsgraph/intern/depsgraph_registry.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/depsgraph') diff --git a/source/blender/depsgraph/intern/depsgraph_registry.cc b/source/blender/depsgraph/intern/depsgraph_registry.cc index bc3b85f9be5..c9d03e47ded 100644 --- a/source/blender/depsgraph/intern/depsgraph_registry.cc +++ b/source/blender/depsgraph/intern/depsgraph_registry.cc @@ -30,9 +30,7 @@ namespace blender { namespace deg { -/* TODO: Static variables should use RawAllocator to avoid false positives of Blender's memory leak - * detector. */ -static Map
> g_graph_registry; +static RawMap
> g_graph_registry; void register_graph(Depsgraph *depsgraph) { @@ -43,7 +41,7 @@ void register_graph(Depsgraph *depsgraph) void unregister_graph(Depsgraph *depsgraph) { Main *bmain = depsgraph->bmain; - VectorSet &graphs = g_graph_registry.lookup(bmain); + RawVectorSet &graphs = g_graph_registry.lookup(bmain); graphs.remove(depsgraph); // If this was the last depsgraph associated with the main, remove the main entry as well. @@ -54,7 +52,7 @@ void unregister_graph(Depsgraph *depsgraph) Span get_all_registered_graphs(Main *bmain) { - VectorSet *graphs = g_graph_registry.lookup_ptr(bmain); + RawVectorSet *graphs = g_graph_registry.lookup_ptr(bmain); if (graphs != nullptr) { return *graphs; } -- cgit v1.2.3