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/SceneGraph | |
parent | 78196d60d1a4585c613f822040f7dc339b9558b4 (diff) |
optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro.
Diffstat (limited to 'source/gameengine/SceneGraph')
-rw-r--r-- | source/gameengine/SceneGraph/SG_BBox.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Controller.h | 9 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_DList.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_IObject.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Node.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_ParentRelation.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_QList.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Spatial.h | 4 | ||||
-rw-r--r-- | source/gameengine/SceneGraph/SG_Tree.h | 8 |
9 files changed, 12 insertions, 33 deletions
diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index 33e29b85a5f..cd1c523ff40 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -136,9 +136,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_BBox") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index 7100debe632..d82738dbb86 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -43,12 +43,6 @@ class SG_Controller { public: - -#ifdef WITH_CXX_GUARDEDALLOC - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); } - void operator delete( void *mem ) { MEM_freeN(mem); } -#endif - SG_Controller( ) : m_pObject(NULL) { @@ -122,6 +116,9 @@ public: protected: SG_IObject* m_pObject; +#ifdef WITH_CXX_GUARDEDALLOC + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Controller") +#endif }; #endif //__SG_CONTROLLER_H__ diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index 90e3226f227..be1c1fda2f2 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -217,9 +217,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_DList") #endif }; diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index a1d4207e508..c36c984f3d3 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -367,9 +367,7 @@ protected : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_IObject") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 41133495f2e..1d0c0e592e6 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -271,9 +271,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Node") #endif }; diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 4140563828f..925c0ed2766 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -131,9 +131,7 @@ protected : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_ParentRelation") #endif }; diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index e1288877b1d..bcc56f05615 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -157,9 +157,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_QList") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index 32f91103369..e456851d183 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -287,9 +287,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Spatial") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h index b2cbb227f77..e0d5c712b73 100644 --- a/source/gameengine/SceneGraph/SG_Tree.h +++ b/source/gameengine/SceneGraph/SG_Tree.h @@ -115,9 +115,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Tree") #endif }; @@ -158,9 +156,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_TreeFactory") #endif }; |