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. --- .../Physics/Bullet/CcdPhysicsController.h | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsController.h') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 8eb2e616ecf..69b16ca35bd 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -58,8 +58,6 @@ class btCollisionShape; class CcdShapeConstructionInfo { public: - - static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact); CcdShapeConstructionInfo() : @@ -191,6 +189,13 @@ protected: bool m_forceReInstance; //use gimpact for concave dynamic/moving collision detection float m_weldingThreshold1; //welding closeby vertices together can improve softbody stability etc. CcdShapeConstructionInfo* m_shapeProxy; // only used for PHY_SHAPE_PROXY, pointer to actual shape info + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; struct CcdConstructionInfo @@ -559,7 +564,11 @@ protected: } - +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -587,7 +596,13 @@ class DefaultMotionState : public PHY_IMotionState btTransform m_worldTransform; btVector3 m_localScaling; - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; -- cgit v1.2.3