diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-25 13:14:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-25 13:14:37 +0400 |
commit | cc0784c1b9c4d813837dedddd5b2b4c52fe291f0 (patch) | |
tree | c898623170b1576dddeb38f1ef30aa3cc83d6567 /source/gameengine/Expressions | |
parent | 78196d60d1a4585c613f822040f7dc339b9558b4 (diff) |
optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/BoolValue.h | 5 | ||||
-rw-r--r-- | source/gameengine/Expressions/ConstExpr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/EmptyValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/ErrorValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Expression.h | 8 | ||||
-rw-r--r-- | source/gameengine/Expressions/FloatValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/IdentifierExpr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/IfExpr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/InputParser.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/IntValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/KX_HashedPtr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Operator1Expr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Operator2Expr.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.h | 16 | ||||
-rw-r--r-- | source/gameengine/Expressions/StringValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/Value.h | 9 | ||||
-rw-r--r-- | source/gameengine/Expressions/VectorValue.h | 4 | ||||
-rw-r--r-- | source/gameengine/Expressions/VoidValue.h | 4 |
18 files changed, 22 insertions, 72 deletions
diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index 48238264f1b..09e931ea661 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -56,11 +56,8 @@ public: private: bool m_bool; - #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CBoolValue") #endif }; diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h index 30b830cb92c..86d411cef26 100644 --- a/source/gameengine/Expressions/ConstExpr.h +++ b/source/gameengine/Expressions/ConstExpr.h @@ -47,9 +47,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CConstExpr") #endif }; diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h index 73946da6705..54920359f3f 100644 --- a/source/gameengine/Expressions/EmptyValue.h +++ b/source/gameengine/Expressions/EmptyValue.h @@ -41,9 +41,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CEmptyValue") #endif }; diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h index 484d135f406..12bc7c7ffcb 100644 --- a/source/gameengine/Expressions/ErrorValue.h +++ b/source/gameengine/Expressions/ErrorValue.h @@ -39,9 +39,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CErrorValue") #endif }; diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 8a4ba8bb7e2..5f5db505331 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -74,9 +74,7 @@ class CBrokenLinkInfo #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CBrokenLinkInfo") #endif }; @@ -144,9 +142,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CExpression") #endif }; diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index 75b2202eb7e..59311e5d373 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -50,9 +50,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CFloatValue") #endif }; diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h index 632a1e0a6d9..58e75c4b02e 100644 --- a/source/gameengine/Expressions/IdentifierExpr.h +++ b/source/gameengine/Expressions/IdentifierExpr.h @@ -52,9 +52,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIdentifierExpr") #endif }; diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h index c0caa7f3e17..f8ed81168d0 100644 --- a/source/gameengine/Expressions/IfExpr.h +++ b/source/gameengine/Expressions/IfExpr.h @@ -51,9 +51,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIfExpr") #endif }; diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h index 085e6870429..6dfeff55105 100644 --- a/source/gameengine/Expressions/InputParser.h +++ b/source/gameengine/Expressions/InputParser.h @@ -110,9 +110,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CParser") #endif }; diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 733ee8bfa4e..e728467cc4e 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -65,9 +65,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIntValue") #endif }; diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h index edb68f2861d..ffc6ff647d5 100644 --- a/source/gameengine/Expressions/KX_HashedPtr.h +++ b/source/gameengine/Expressions/KX_HashedPtr.h @@ -54,9 +54,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CHashedPtr") #endif }; diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h index 9815ce16e95..13a1b16500a 100644 --- a/source/gameengine/Expressions/Operator1Expr.h +++ b/source/gameengine/Expressions/Operator1Expr.h @@ -52,9 +52,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:") #endif }; diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h index 8b1c5523a2f..23272930131 100644 --- a/source/gameengine/Expressions/Operator2Expr.h +++ b/source/gameengine/Expressions/Operator2Expr.h @@ -58,9 +58,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:COperator2Expr") #endif }; diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 124a8e28f57..af8acaa993f 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -534,21 +534,11 @@ typedef PyTypeObject *PyParentObject; /* Define the PyParent Object */ #ifdef WITH_CXX_GUARDEDALLOC #define Py_Header \ public: \ - void *operator new(size_t num_bytes) { \ - return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); \ - } \ - void operator delete( void *mem ) { \ - MEM_freeN(mem); \ - } \ + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PyObjectPlus") \ + #define Py_HeaderPtr \ -public: \ - void *operator new(size_t num_bytes) { \ - return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); \ - } \ - void operator delete( void *mem ) { \ - MEM_freeN(mem); \ - } \ + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PyObjectPlusPtr") \ #else // WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index 931858b7eed..aa4a1a0bb00 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -53,9 +53,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CStringValue") #endif }; diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 261f5244f21..e3b52e80ba6 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -164,9 +164,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CAction") #endif }; @@ -436,11 +434,8 @@ public: protected: STR_String m_strNewName; // Identification - #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CPropValue") #endif }; diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h index 5d0e0c0ddb2..b7afa61d4dd 100644 --- a/source/gameengine/Expressions/VectorValue.h +++ b/source/gameengine/Expressions/VectorValue.h @@ -86,9 +86,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CVectorValue") #endif }; diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index 8e2545b309d..5599b226a60 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -66,9 +66,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CVoidValue") #endif }; |