[Bf-blender-cvs] [e16afbe4f50] functions: use guarded allocator for some core types

Jacques Lucke noreply at git.blender.org
Wed Aug 14 15:34:51 CEST 2019


Commit: e16afbe4f50dc6a38cedf8a66c9f382188cd7825
Author: Jacques Lucke
Date:   Wed Aug 14 14:59:24 2019 +0200
Branches: functions
https://developer.blender.org/rBe16afbe4f50dc6a38cedf8a66c9f382188cd7825

use guarded allocator for some core types

===================================================================

M	source/blender/functions/core/data_graph.hpp
M	source/blender/functions/core/function.hpp
M	source/blender/functions/core/type.hpp

===================================================================

diff --git a/source/blender/functions/core/data_graph.hpp b/source/blender/functions/core/data_graph.hpp
index 33518c89f7f..f79d4b9137b 100644
--- a/source/blender/functions/core/data_graph.hpp
+++ b/source/blender/functions/core/data_graph.hpp
@@ -213,6 +213,10 @@ class DataGraph : public RefCounter {
   DataGraph(DataGraph &other) = delete;
   ~DataGraph();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:DataGraph")
+#endif
+
   Range<uint> node_ids() const
   {
     return Range<uint>(0, m_nodes.size());
diff --git a/source/blender/functions/core/function.hpp b/source/blender/functions/core/function.hpp
index 942017fa390..21e39c5ba1b 100644
--- a/source/blender/functions/core/function.hpp
+++ b/source/blender/functions/core/function.hpp
@@ -66,6 +66,10 @@ class Function final : public RefCounter {
 
   ~Function();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:Function")
+#endif
+
   /**
    * Get the name of the function.
    */
diff --git a/source/blender/functions/core/type.hpp b/source/blender/functions/core/type.hpp
index adc5370b52d..c0f84e14aa1 100644
--- a/source/blender/functions/core/type.hpp
+++ b/source/blender/functions/core/type.hpp
@@ -23,6 +23,7 @@
 #include <mutex>
 #include "BLI_refcount.hpp"
 #include "BLI_string_ref.hpp"
+#include "MEM_guardedalloc.h"
 
 namespace FN {
 
@@ -55,6 +56,10 @@ class Type final {
   Type(StringRef name);
   ~Type();
 
+#ifdef WITH_CXX_GUARDEDALLOC
+  MEM_CXX_CLASS_ALLOC_FUNCS("FN:Types")
+#endif
+
   /**
    * Get the name of the type.
    */



More information about the Bf-blender-cvs mailing list