[Bf-blender-cvs] [d54eca1] object_nodes: Use the guardedalloc new/delete overloads for relevant classes.
Lukas Tönne
noreply at git.blender.org
Wed Nov 25 09:53:37 CET 2015
Commit: d54eca15d642a149dd0146696181d45299c1038b
Author: Lukas Tönne
Date: Wed Nov 25 09:53:01 2015 +0100
Branches: object_nodes
https://developer.blender.org/rBd54eca15d642a149dd0146696181d45299c1038b
Use the guardedalloc new/delete overloads for relevant classes.
===================================================================
M source/blender/blenvm/bvm/bvm_eval.h
M source/blender/blenvm/bvm/bvm_function.h
M source/blender/blenvm/compile/bvm_codegen.h
M source/blender/blenvm/compile/bvm_nodegraph.h
M source/blender/blenvm/intern/bvm_api.cc
===================================================================
diff --git a/source/blender/blenvm/bvm/bvm_eval.h b/source/blender/blenvm/bvm/bvm_eval.h
index 791cd12..e505989 100644
--- a/source/blender/blenvm/bvm/bvm_eval.h
+++ b/source/blender/blenvm/bvm/bvm_eval.h
@@ -34,6 +34,8 @@
#include <vector>
+#include "MEM_guardedalloc.h"
+
#include "bvm_util_map.h"
#include "bvm_util_string.h"
#include "bvm_util_typedesc.h"
@@ -70,6 +72,8 @@ struct EvalGlobals {
typedef std::vector<Object *> ObjectList;
ObjectList objects;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:EvalGlobals")
};
struct EffectorEvalData {
@@ -104,6 +108,8 @@ struct EvalData {
EffectorEvalData effector;
TextureEvalData texture;
ModifierEvalData modifier;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:EvalData")
};
struct EvalContext {
@@ -114,6 +120,8 @@ struct EvalContext {
protected:
void eval_instructions(const EvalGlobals *globals, const EvalData *data, const Function *fn, float *stack) const;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:EvalContext")
};
} /* namespace bvm */
diff --git a/source/blender/blenvm/bvm/bvm_function.h b/source/blender/blenvm/bvm/bvm_function.h
index cbc0e12..8317d62 100644
--- a/source/blender/blenvm/bvm/bvm_function.h
+++ b/source/blender/blenvm/bvm/bvm_function.h
@@ -35,6 +35,8 @@
#include <vector>
#include <stdint.h>
+#include "MEM_guardedalloc.h"
+
#include "bvm_opcode.h"
#include "bvm_util_string.h"
#include "bvm_util_typedesc.h"
@@ -105,6 +107,8 @@ struct ReturnValue {
TypeDesc typedesc;
string name;
StackIndex stack_offset;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:ReturnValue")
};
struct Function {
@@ -208,6 +212,8 @@ struct Function {
private:
ReturnValueList return_values;
InstructionList instructions;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:Function")
};
} /* namespace bvm */
diff --git a/source/blender/blenvm/compile/bvm_codegen.h b/source/blender/blenvm/compile/bvm_codegen.h
index d4e36d6..28b6c18 100644
--- a/source/blender/blenvm/compile/bvm_codegen.h
+++ b/source/blender/blenvm/compile/bvm_codegen.h
@@ -34,6 +34,8 @@
#include <vector>
+#include "MEM_guardedalloc.h"
+
#include "bvm_function.h"
#include "bvm_opcode.h"
#include "bvm_util_string.h"
@@ -70,6 +72,8 @@ struct BVMCompiler {
private:
StackUsers stack_users;
Function *fn;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:BVMCompiler")
};
} /* namespace bvm */
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.h b/source/blender/blenvm/compile/bvm_nodegraph.h
index c04e5fc..9778349 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.h
+++ b/source/blender/blenvm/compile/bvm_nodegraph.h
@@ -38,6 +38,8 @@
#include <map>
#include <vector>
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_utildefines.h"
#if 0
@@ -108,6 +110,8 @@ struct NodeType {
SocketList inputs;
SocketList outputs;
bool is_pass; /* pass nodes are skipped */
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:NodeType")
};
struct ConstSocketPair {
@@ -248,6 +252,8 @@ struct NodeInstance {
string name;
InputMap inputs;
OutputMap outputs;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:NodeInstance")
};
struct NodeGraphInput {
@@ -361,6 +367,8 @@ public:
NodeInstanceMap nodes;
InputList inputs;
OutputList outputs;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:NodeGraph")
};
OpCode get_opcode_from_node_type(const string &node);
diff --git a/source/blender/blenvm/intern/bvm_api.cc b/source/blender/blenvm/intern/bvm_api.cc
index d54d3e9..a6e225b 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -31,6 +31,8 @@
#include <set>
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
@@ -166,6 +168,8 @@ struct CompileContext {
else
return -1;
}
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:CompileContext")
};
inline static CompileContext *_COMP(BVMCompileContext *c)
@@ -460,6 +464,8 @@ private:
InputMap m_input_map;
OutputMap m_output_map;
+
+ MEM_CXX_CLASS_ALLOC_FUNCS("BVM:bNodeCompiler")
};
More information about the Bf-blender-cvs
mailing list