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_WorldInfo.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_WorldInfo.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_WorldInfo.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h index fe4e0c51b24..2c2346ca38e 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.h +++ b/source/gameengine/Ketsji/KX_WorldInfo.h @@ -31,6 +31,10 @@ #include "MT_Scalar.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class MT_CmMatrix4x4; class KX_WorldInfo @@ -59,6 +63,13 @@ public: virtual void setMistColorRed(float)=0; virtual void setMistColorGreen(float)=0; virtual void setMistColorBlue(float)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_WORLDINFO_H |