From 14d33b3c1fd629ca3ebc2f369b38d9d2ebc09e2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 15:37:31 +0000 Subject: 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. --- source/gameengine/Ketsji/KX_LightIpoSGController.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/gameengine/Ketsji/KX_LightIpoSGController.h') diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h index 98870cf5b3f..811dba5dba8 100644 --- a/source/gameengine/Ketsji/KX_LightIpoSGController.h +++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h @@ -92,6 +92,13 @@ public: }; void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_LIGHTIPOSGCONTROLLER_H -- cgit v1.2.3