diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-18 19:37:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-18 19:37:31 +0400 |
commit | 14d33b3c1fd629ca3ebc2f369b38d9d2ebc09e2e (patch) | |
tree | 5304235c3b0bb3f850a0b8e38c96618e9a6cb5aa /source/gameengine/Ketsji/KX_SG_NodeRelationships.h | |
parent | 368262461641f23239c1a7bd2e6fa9d5057902e7 (diff) |
BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for better tracking memory usage.
* off by default.
* new/delete are at the bottom of each class
* python BGE objects have the new/delete in the Py_Header macro.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SG_NodeRelationships.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_SG_NodeRelationships.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h index d8fb9211f21..c1640f3e0a0 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h @@ -53,7 +53,6 @@ class KX_NormalParentRelation : public SG_ParentRelation { public : - /** * Allocate and construct a new KX_NormalParentRelation * on the heap. @@ -91,6 +90,12 @@ private : KX_NormalParentRelation( ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -142,6 +147,12 @@ private : KX_VertexParentRelation( ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -219,6 +230,12 @@ private : bool m_initialized; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif |