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. --- .../gameengine/BlenderRoutines/KX_BlenderCanvas.h | 11 +++++++++++ .../BlenderRoutines/KX_BlenderInputDevice.h | 10 +++++++++- .../BlenderRoutines/KX_BlenderKeyboardDevice.h | 11 +++++++++++ .../BlenderRoutines/KX_BlenderMouseDevice.h | 11 +++++++++++ .../BlenderRoutines/KX_BlenderRenderTools.h | 11 +++++++++++ .../gameengine/BlenderRoutines/KX_BlenderSystem.h | 12 +++++++++++ source/gameengine/Converter/BL_ArmatureObject.h | 7 +++++++ .../gameengine/Converter/BL_DeformableGameObject.h | 7 ++++++- source/gameengine/Converter/BL_MeshDeformer.h | 7 +++++++ source/gameengine/Converter/BL_ModifierDeformer.h | 6 ++++++ source/gameengine/Converter/BL_ShapeDeformer.h | 6 ++++++ source/gameengine/Converter/BL_SkinDeformer.h | 6 ++++++ source/gameengine/Converter/BL_SkinMeshObject.h | 7 +++++++ source/gameengine/Converter/BlenderWorldInfo.h | 7 +++++++ .../Converter/KX_BlenderScalarInterpolator.h | 14 +++++++++++++ .../Converter/KX_BlenderSceneConverter.h | 6 ++++++ source/gameengine/Expressions/BoolValue.h | 7 +++++++ source/gameengine/Expressions/ConstExpr.h | 7 +++++++ source/gameengine/Expressions/EmptyValue.h | 7 +++++++ source/gameengine/Expressions/ErrorValue.h | 7 +++++++ source/gameengine/Expressions/Expression.h | 13 ++++++++++++ source/gameengine/Expressions/FloatValue.h | 6 ++++++ source/gameengine/Expressions/IdentifierExpr.h | 7 +++++++ source/gameengine/Expressions/IfExpr.h | 7 +++++++ source/gameengine/Expressions/InputParser.h | 8 +++++++- source/gameengine/Expressions/IntValue.h | 6 ++++++ source/gameengine/Expressions/KX_HashedPtr.h | 11 +++++++++++ source/gameengine/Expressions/Operator1Expr.h | 7 +++++++ source/gameengine/Expressions/Operator2Expr.h | 8 +++++++- source/gameengine/Expressions/PyObjectPlus.h | 12 ++++++++++- source/gameengine/Expressions/StringValue.h | 7 +++++++ source/gameengine/Expressions/Value.h | 19 +++++++++++++++++- source/gameengine/Expressions/VectorValue.h | 7 +++++++ source/gameengine/Expressions/VoidValue.h | 7 +++++++ .../GameLogic/SCA_ActuatorEventManager.h | 7 +++++++ .../gameengine/GameLogic/SCA_AlwaysEventManager.h | 5 +++++ source/gameengine/GameLogic/SCA_EventManager.h | 7 +++++++ .../GameLogic/SCA_ExpressionController.h | 7 +++++++ source/gameengine/GameLogic/SCA_IActuator.h | 7 +++++++ source/gameengine/GameLogic/SCA_IInputDevice.h | 10 ++++++++++ source/gameengine/GameLogic/SCA_IScene.h | 11 +++++++++++ source/gameengine/GameLogic/SCA_JoystickManager.h | 6 ++++++ source/gameengine/GameLogic/SCA_KeyboardManager.h | 7 +++++++ source/gameengine/GameLogic/SCA_LogicManager.h | 7 +++++++ source/gameengine/GameLogic/SCA_MouseManager.h | 7 +++++++ .../GameLogic/SCA_PropertyEventManager.h | 6 ++++++ .../gameengine/GameLogic/SCA_RandomEventManager.h | 7 +++++++ .../GameLogic/SCA_RandomNumberGenerator.h | 11 +++++++++++ source/gameengine/GameLogic/SCA_TimeEventManager.h | 7 +++++++ source/gameengine/Ketsji/BL_BlenderShader.h | 7 +++++++ source/gameengine/Ketsji/BL_Material.h | 11 +++++++++++ source/gameengine/Ketsji/BL_Shader.h | 20 +++++++++++++++++++ source/gameengine/Ketsji/BL_Texture.h | 6 ++++++ source/gameengine/Ketsji/KX_BlenderMaterial.h | 4 ++++ .../gameengine/Ketsji/KX_BulletPhysicsController.h | 7 ++++++- .../gameengine/Ketsji/KX_CameraIpoSGController.h | 7 +++++++ source/gameengine/Ketsji/KX_ClientObjectInfo.h | 7 +++++++ source/gameengine/Ketsji/KX_Dome.h | 11 +++++++++-- source/gameengine/Ketsji/KX_EmptyObject.h | 8 +++++++- source/gameengine/Ketsji/KX_IInterpolator.h | 11 +++++++++++ source/gameengine/Ketsji/KX_IPO_SGController.h | 6 ++++++ source/gameengine/Ketsji/KX_IPhysicsController.h | 7 +++++++ source/gameengine/Ketsji/KX_IScalarInterpolator.h | 11 +++++++++++ source/gameengine/Ketsji/KX_ISceneConverter.h | 11 +++++++++++ source/gameengine/Ketsji/KX_ISystem.h | 11 +++++++++++ source/gameengine/Ketsji/KX_KetsjiEngine.h | 8 +++++++- source/gameengine/Ketsji/KX_LightIpoSGController.h | 7 +++++++ .../gameengine/Ketsji/KX_MaterialIpoController.h | 7 +++++++ source/gameengine/Ketsji/KX_MotionState.h | 10 ++++++++++ .../gameengine/Ketsji/KX_ObColorIpoSGController.h | 7 +++++++ .../gameengine/Ketsji/KX_OrientationInterpolator.h | 7 +++++++ source/gameengine/Ketsji/KX_PolygonMaterial.h | 5 +++++ source/gameengine/Ketsji/KX_PositionInterpolator.h | 7 +++++++ source/gameengine/Ketsji/KX_RayCast.h | 14 ++++++++++++- source/gameengine/Ketsji/KX_RayEventManager.h | 7 +++++++ .../Ketsji/KX_SG_BoneParentNodeRelationship.h | 7 ++++++- source/gameengine/Ketsji/KX_SG_NodeRelationships.h | 19 +++++++++++++++++- source/gameengine/Ketsji/KX_ScalarInterpolator.h | 7 +++++++ source/gameengine/Ketsji/KX_ScalingInterpolator.h | 7 +++++++ source/gameengine/Ketsji/KX_TimeCategoryLogger.h | 6 ++++++ source/gameengine/Ketsji/KX_TimeLogger.h | 11 +++++++++++ source/gameengine/Ketsji/KX_TouchEventManager.h | 6 ++++++ source/gameengine/Ketsji/KX_WorldInfo.h | 11 +++++++++++ source/gameengine/Ketsji/KX_WorldIpoController.h | 7 +++++++ .../gameengine/Network/NG_NetworkDeviceInterface.h | 7 +++++++ source/gameengine/Network/NG_NetworkMessage.h | 11 +++++++++++ source/gameengine/Network/NG_NetworkObject.h | 11 +++++++++++ source/gameengine/Network/NG_NetworkScene.h | 13 +++++++++++- .../Physics/Bullet/CcdGraphicController.h | 6 ++++++ .../Physics/Bullet/CcdPhysicsController.h | 23 ++++++++++++++++++---- .../Physics/Bullet/CcdPhysicsEnvironment.h | 6 +++++- .../Physics/Dummy/DummyPhysicsEnvironment.h | 6 ++++++ source/gameengine/Physics/common/PHY_IController.h | 11 +++++++++-- .../Physics/common/PHY_IGraphicController.h | 7 +++++-- .../gameengine/Physics/common/PHY_IMotionState.h | 14 +++++++++++-- .../Physics/common/PHY_IPhysicsController.h | 6 +++++- .../Physics/common/PHY_IPhysicsEnvironment.h | 18 +++++++++++++++++ source/gameengine/Physics/common/PHY_IVehicle.h | 11 ++++++++++- source/gameengine/Rasterizer/RAS_2DFilterManager.h | 11 +++++++++++ source/gameengine/Rasterizer/RAS_BucketManager.h | 6 ++++++ source/gameengine/Rasterizer/RAS_Deformer.h | 10 ++++++++++ source/gameengine/Rasterizer/RAS_FramingManager.h | 19 +++++++++++++++++- source/gameengine/Rasterizer/RAS_ICanvas.h | 11 +++++++++++ .../gameengine/Rasterizer/RAS_IPolygonMaterial.h | 12 ++++++++++- source/gameengine/Rasterizer/RAS_IRasterizer.h | 12 ++++++++++- source/gameengine/Rasterizer/RAS_IRenderTools.h | 11 +++++++++++ source/gameengine/Rasterizer/RAS_MaterialBucket.h | 20 +++++++++++++++++++ source/gameengine/Rasterizer/RAS_MeshObject.h | 7 +++++++ .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 7 +++++++ .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 7 +++++++ .../RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h | 6 ++++++ source/gameengine/Rasterizer/RAS_Polygon.h | 10 ++++++++++ source/gameengine/Rasterizer/RAS_Rect.h | 10 ++++++++++ source/gameengine/Rasterizer/RAS_TexVert.h | 10 ++++++++++ source/gameengine/SceneGraph/SG_BBox.h | 10 ++++++++++ source/gameengine/SceneGraph/SG_Controller.h | 6 ++++++ source/gameengine/SceneGraph/SG_DList.h | 11 +++++++++++ source/gameengine/SceneGraph/SG_IObject.h | 7 +++++-- source/gameengine/SceneGraph/SG_Node.h | 7 ++++++- source/gameengine/SceneGraph/SG_ParentRelation.h | 8 +++++++- source/gameengine/SceneGraph/SG_QList.h | 7 +++++++ source/gameengine/SceneGraph/SG_Spatial.h | 7 ++++++- source/gameengine/SceneGraph/SG_Tree.h | 13 ++++++++++++ 123 files changed, 1068 insertions(+), 36 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index fd41fb90f2f..d49c877f610 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -40,6 +40,10 @@ #include "KX_BlenderGL.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct ARegion; struct wmWindow; @@ -166,6 +170,13 @@ private: struct ARegion* m_ar; struct wmWindow* m_win; RAS_Rect m_area_rect; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_BLENDERCANVAS diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h index 32391e63264..d4dd9af3d4f 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h @@ -39,7 +39,9 @@ #include "WM_types.h" #include "SCA_IInputDevice.h" - +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif /** Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. @@ -222,6 +224,12 @@ public: // virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERINPUTDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h index 5bf37acf236..c801322e787 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h @@ -31,6 +31,10 @@ #include "KX_BlenderInputDevice.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderKeyboardDevice : public BL_BlenderInputDevice { bool m_hookesc; @@ -43,6 +47,13 @@ public: virtual bool ConvertBlenderEvent(unsigned short incode,short val); virtual void NextFrame(); virtual void HookEscape(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERKEYBOARDDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h index 2f9e956a1d8..92383e4b533 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h @@ -31,6 +31,10 @@ #include "KX_BlenderInputDevice.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderMouseDevice : public BL_BlenderInputDevice { public: @@ -41,6 +45,13 @@ public: // virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode); virtual bool ConvertBlenderEvent(unsigned short incode,short val); virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERMOUSEDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h index 60130e6bfc9..70672b8350b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h @@ -37,6 +37,10 @@ #include "RAS_IRenderTools.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct KX_ClientObjectInfo; class KX_RayCast; @@ -95,6 +99,13 @@ public: virtual void Render2DFilters(RAS_ICanvas* canvas); virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERRENDERTOOLS diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h index d99bb9b14a8..b6b2841e81c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h @@ -34,6 +34,10 @@ */ #include "KX_ISystem.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderSystem : public KX_ISystem { double m_starttime; @@ -42,6 +46,14 @@ public: KX_BlenderSystem(); virtual ~KX_BlenderSystem() {}; virtual double GetTimeInSeconds(); + + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERSYSTEM diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 684d89d492b..af0b7dc201c 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -93,6 +93,13 @@ protected: short m_activePriority; double m_lastapplyframe; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ArmatureObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index b20b8e81b37..ed329e7953d 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -45,7 +45,6 @@ struct Key; class BL_DeformableGameObject : public KX_GameObject { public: - CValue* GetReplica(); double GetLastFrame () @@ -100,6 +99,12 @@ protected: Object* m_blendobj; short m_activePriority; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 289826e45e7..1749d438d21 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -85,6 +85,13 @@ protected: int m_tvtot; BL_DeformableGameObject* m_gameobj; double m_lastDeformUpdate; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index b09cc2087ca..5cc84c7d1e4 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -101,6 +101,12 @@ protected: Scene *m_scene; DerivedMesh *m_dm; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 949e5e1e3ad..ca3770d4006 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -83,6 +83,12 @@ protected: vector m_shapeDrivers; double m_lastShapeUpdate; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 7c43246a9d7..b83895d5609 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -105,6 +105,12 @@ protected: bool m_poseApplied; bool m_recalcNormal; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index e2d0e37664d..838c6c3cb95 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -54,6 +54,13 @@ public: // for shape keys, void CheckWeightCache(struct Object* obj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinMeshObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h index fd6bb0212b7..7ccb96e4683 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.h +++ b/source/gameengine/Converter/BlenderWorldInfo.h @@ -94,6 +94,13 @@ public: setMistColorBlue( float d ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__BLENDERWORLDINFO_H diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index 396a7d197df..eb15cee8ff9 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -49,6 +49,13 @@ public: private: struct FCurve *m_fcu; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -58,6 +65,13 @@ public: ~BL_InterpolatorList(); KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_SCALARINTERPOLATOR_H diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 7b5351344ae..bb87a21a683 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -143,6 +143,12 @@ public: struct Main* GetMain() { return m_maggie; }; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERSCENECONVERTER_H diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index 726619e7193..4d0103ec1dd 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -49,6 +49,13 @@ public: private: bool m_bool; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _BOOLVALUE_H diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h index b117140fe70..f48b8d34355 100644 --- a/source/gameengine/Expressions/ConstExpr.h +++ b/source/gameengine/Expressions/ConstExpr.h @@ -41,6 +41,13 @@ public: private: CValue* m_value; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_CONSTEXPR_H__061ECFC3_BE87_11D1_A51C_00A02472FC58__INCLUDED_) diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h index fb6b4a477a6..01029d1655d 100644 --- a/source/gameengine/Expressions/EmptyValue.h +++ b/source/gameengine/Expressions/EmptyValue.h @@ -34,6 +34,13 @@ public: CValue * Calc(VALUE_OPERATOR op, CValue *val); CValue * CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); virtual CValue* GetReplica(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _EMPTYVALUE_H diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h index b4b758feea7..2f65850c4f1 100644 --- a/source/gameengine/Expressions/ErrorValue.h +++ b/source/gameengine/Expressions/ErrorValue.h @@ -33,6 +33,13 @@ public: private: STR_String m_strErrorText; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _ERRORVALUE_H diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 400a2b7c789..bd346fd0552 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -63,6 +63,12 @@ class CBrokenLinkInfo CExpression* m_pExpr; bool m_bRestored; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -126,6 +132,13 @@ public: protected: int m_refcount; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _EXPRESSION_H diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index fb75b7c702b..442f0eb6cf8 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -42,6 +42,12 @@ protected: float m_float; STR_String* m_pstrRep; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _FLOATVALUE_H diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h index b307228c8b9..7c14329f755 100644 --- a/source/gameengine/Expressions/IdentifierExpr.h +++ b/source/gameengine/Expressions/IdentifierExpr.h @@ -46,6 +46,13 @@ public: virtual CExpression* CheckLink(std::vector& brokenlinks); virtual void ClearModified(); virtual void BroadcastOperators(VALUE_OPERATOR op); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__IDENTIFIER_EXPR diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h index 9ab13dca413..f06718c851f 100644 --- a/source/gameengine/Expressions/IfExpr.h +++ b/source/gameengine/Expressions/IfExpr.h @@ -44,6 +44,13 @@ public: virtual CExpression* CheckLink(std::vector& brokenlinks); virtual void ClearModified(); virtual void BroadcastOperators(VALUE_OPERATOR op); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_IFEXPR_H__1F691841_C5C7_11D1_A863_0000B4542BD8__INCLUDED_) diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h index 810bdc244a8..0d7eab27aeb 100644 --- a/source/gameengine/Expressions/InputParser.h +++ b/source/gameengine/Expressions/InputParser.h @@ -102,7 +102,13 @@ private: int Priority(int optor); CExpression *Ex(int i); CExpression *Expr(); - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 06bf1755749..0513026c4cf 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -56,6 +56,12 @@ private: cInt m_int; STR_String* m_pstrRep; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _INTVALUE_H diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h index b11efb99d68..0b54436147b 100644 --- a/source/gameengine/Expressions/KX_HashedPtr.h +++ b/source/gameengine/Expressions/KX_HashedPtr.h @@ -29,6 +29,10 @@ #ifndef __KX_HASHEDPTR #define __KX_HASHEDPTR +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + unsigned int KX_Hash(void * inDWord); class CHashedPtr @@ -44,6 +48,13 @@ public: { return rhs.m_valptr == lhs.m_valptr; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_HASHEDPTR diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h index 4a1deb0eca3..c2bc68076a0 100644 --- a/source/gameengine/Expressions/Operator1Expr.h +++ b/source/gameengine/Expressions/Operator1Expr.h @@ -46,6 +46,13 @@ public: private: VALUE_OPERATOR m_op; CExpression * m_lhs; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_OPERATOR1EXPR_H__A1653901_BF41_11D1_A51C_00A02472FC58__INCLUDED_) diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h index 4064890bbae..bb26b7c03be 100644 --- a/source/gameengine/Expressions/Operator2Expr.h +++ b/source/gameengine/Expressions/Operator2Expr.h @@ -52,7 +52,13 @@ protected: private: VALUE_OPERATOR m_op; - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _OPERATOR2EXPR_H diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index d68aa9f0410..e9e81dddaaa 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -102,7 +102,7 @@ typedef struct { // This must be the first line of each // PyC++ class -#define Py_Header \ +#define __Py_Header \ public: \ static PyTypeObject Type; \ static PyMethodDef Methods[]; \ @@ -111,6 +111,16 @@ typedef struct { virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \ virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \ + +#ifdef WITH_CXX_GUARDEDALLOC +#define Py_Header __Py_Header \ + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ + void operator delete( void *mem ) { MEM_freeN(mem); } \ + +#else +#define Py_Header __Py_Header +#endif + /* * nonzero values are an error for setattr * however because of the nested lookups we need to know if the errors diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index c580e8fd23a..069eb8d9c24 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -46,6 +46,13 @@ public: private: // data member STR_String m_strString; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 8c9f99b335e..5f08736afde 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -42,6 +42,10 @@ #include // array functionality for the propertylist #include "STR_String.h" // STR_String class +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + #ifndef GEN_NO_ASSERT #undef assert #define assert(exp) ((void)NULL) @@ -173,6 +177,13 @@ public: virtual ~CAction(){ }; virtual void Execute() const =0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; // @@ -407,7 +418,6 @@ public: \ class CPropValue : public CValue { public: - #ifndef NO_EXP_PYTHON_EMBEDDING CPropValue() : CValue(), @@ -436,6 +446,13 @@ public: protected: STR_String m_strNewName; // Identification + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VALUEBASECLASS_H diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h index 19c7dd30076..49fb1e7ea08 100644 --- a/source/gameengine/Expressions/VectorValue.h +++ b/source/gameengine/Expressions/VectorValue.h @@ -79,6 +79,13 @@ public: protected: double m_vec[3]; double m_transformedvec[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VECTORVALUE_H diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index 10a6ff9ad3d..50ec4ff1ee7 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -59,6 +59,13 @@ public: /// Data members bool m_bDeleteOnDestruct; void* m_pAnything; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VOIDVALUE_H diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h index a7d61627c23..f3884c87a75 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -45,6 +45,13 @@ public: virtual void NextFrame(); virtual void UpdateFrame(); //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ACTUATOREVENTMANAGER diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h index a619eecddd4..9540e3b71f6 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h @@ -41,6 +41,11 @@ public: virtual void NextFrame(); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ALWAYSEVENTMGR diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 5ff55849bfe..424150ffa63 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -71,6 +71,13 @@ public: protected: EVENT_MANAGER_TYPE m_mgrtype; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 705f6dfc415..4c1dfcb95a2 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -53,6 +53,13 @@ public: * so that self references are removed before the controller itself is released */ virtual void Delete(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_EXPRESSIONCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 13c718ee837..00ba8c9ce4e 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -127,6 +127,13 @@ public: void IncLink() { m_links++; } void DecLink(); bool IsNoLink() const { return !m_links; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_IACTUATOR diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h index a0d77ed3c03..228d7684b0f 100644 --- a/source/gameengine/GameLogic/SCA_IInputDevice.h +++ b/source/gameengine/GameLogic/SCA_IInputDevice.h @@ -33,6 +33,10 @@ #ifndef KX_INPUTDEVICE_H #define KX_INPUTDEVICE_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SCA_InputEvent { @@ -302,6 +306,12 @@ public: */ virtual void NextFrame(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //KX_INPUTDEVICE_H diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h index 79d922a998e..ced9ca94cec 100644 --- a/source/gameengine/GameLogic/SCA_IScene.h +++ b/source/gameengine/GameLogic/SCA_IScene.h @@ -33,6 +33,10 @@ #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct SCA_DebugProp { class CValue* m_obj; @@ -60,6 +64,13 @@ public: void AddDebugProperty(class CValue* debugprop, const STR_String &name); void RemoveAllDebugProperties(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ISCENE_H diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h index d3a7ac95bea..be55e95b033 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.h +++ b/source/gameengine/GameLogic/SCA_JoystickManager.h @@ -47,6 +47,12 @@ public: virtual void NextFrame(double curtime,double deltatime); SCA_Joystick* GetJoystickDevice(short int joyindex); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h index 8f3cc0ab715..c5553a74aef 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.h +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h @@ -56,6 +56,13 @@ public: virtual void NextFrame(); SCA_IInputDevice* GetInputDevice(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_KEYBOARDMANAGER diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 53e75e1eaee..402090357cb 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -137,6 +137,13 @@ public: void RegisterGameObj(void* blendobj, CValue* gameobj); void UnregisterGameObj(void* blendobj, CValue* gameobj); CValue* FindGameObjByBlendObj(void* blendobj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_LOGICMANAGER diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h index efa4c639ce7..ef1533c636b 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.h +++ b/source/gameengine/GameLogic/SCA_MouseManager.h @@ -63,6 +63,13 @@ public: bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode); virtual void NextFrame(); SCA_IInputDevice* GetInputDevice(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_MOUSEMANAGER diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h index f166065b198..011f3285f63 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h @@ -40,6 +40,12 @@ class SCA_PropertyEventManager : public SCA_EventManager class SCA_LogicManager* m_logicmgr; public: + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif + SCA_PropertyEventManager(class SCA_LogicManager* logicmgr); virtual ~SCA_PropertyEventManager(); virtual void NextFrame(); diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h index 79138c23c62..c8b511b87b7 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.h +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h @@ -45,6 +45,13 @@ public: SCA_RandomEventManager(class SCA_LogicManager* logicmgr); virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_RANDOMEVENTMGR diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h index 842a0331752..f986fadeaf0 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h @@ -34,6 +34,10 @@ #ifndef __KX_RANDOMNUMBERGENERATOR #define __KX_RANDOMNUMBERGENERATOR +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SCA_RandomNumberGenerator { /* reference counted for memleak */ @@ -69,6 +73,13 @@ class SCA_RandomNumberGenerator { if (--m_refcount == 0) delete this; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __KX_RANDOMNUMBERGENERATOR */ diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h index bd57e12eb44..089f21e603b 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.h +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h @@ -48,6 +48,13 @@ public: virtual void RemoveSensor(class SCA_ISensor* sensor); void AddTimeProperty(CValue* timeval); void RemoveTimeProperty(CValue* timeval); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_TIMEEVENTMANAGER diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 9af53bfc863..073ce8f1ca5 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -57,6 +57,13 @@ public: int GetBlendMode(); bool Equals(BL_BlenderShader *blshader); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif//__BL_GPUSHADER_H__ diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 4f572f95891..6b53e7fa8b1 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -4,6 +4,10 @@ #include "STR_String.h" #include "MT_Point2.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + // -- struct MTex; struct Material; @@ -98,6 +102,13 @@ public: void SetSharedMaterial(bool v); bool IsShared(); void SetUsers(int num); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; // BL_Material::IdMode diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 42969996b3e..b2610d7762a 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -25,6 +25,12 @@ public: { } int mLoc; // Sampler location + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -65,6 +71,13 @@ public: int GetLocation() { return mLoc; } void* getData() { return mData; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -83,6 +96,13 @@ public: int mType; int mLoc; unsigned int mFlag; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h index 830ffceb0f7..2dfd9c542d3 100644 --- a/source/gameengine/Ketsji/BL_Texture.h +++ b/source/gameengine/Ketsji/BL_Texture.h @@ -67,6 +67,12 @@ public: return tmp; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif//__BL_TEXTURE_H__ diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 605ca207949..cdbdc4bd429 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -15,6 +15,10 @@ #include "MT_Vector3.h" #include "MT_Vector4.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct MTFace; class KX_Scene; diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 755b1cbd780..7fc799abb7e 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -18,7 +18,6 @@ private: btCollisionShape* m_bulletChildShape; public: - KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound); virtual ~KX_BulletPhysicsController (); @@ -81,6 +80,12 @@ public: // intentionally empty }; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //KX_BULLET2PHYSICS_CONTROLLER diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h index 33245e79c23..85d93962a14 100644 --- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h +++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h @@ -84,6 +84,13 @@ public: m_modify_clipstart = modify; } void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_CAMERAIPOSGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 1898dc71ef8..74647dd47fd 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -74,6 +74,13 @@ public: bool isActor() { return m_type <= ACTOR; } bool isSensor() { return m_type >= SENSOR && m_type <= OBACTORSENSOR; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_CLIENTOBJECT_INFO_H diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 20b60ef0173..9ff33fe2852 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -18,7 +18,7 @@ http://www.gnu.org/copyleft/lesser.txt. Contributor(s): Dalai Felinto This source uses some of the ideas and code from Paul Bourke. -Developed as part of a Research and Development project for SAT - La Société des arts technologiques. +Developed as part of a Research and Development project for SAT - La Soci�t� des arts technologiques. ----------------------------------------------------------------------------- */ @@ -78,7 +78,7 @@ public: bool fboSupported; //openGL names: - GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180º x 360º dome, 6 for panoramic and +1 for warp mesh + GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180� x 360� dome, 6 for panoramic and +1 for warp mesh GLuint dlistId; // ID of the Display Lists of the images (used as an offset) typedef struct { @@ -184,6 +184,13 @@ protected: RAS_IRenderTools* m_rendertools; /// engine KX_KetsjiEngine* m_engine; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h index 62aa7fcd017..fa405e20076 100644 --- a/source/gameengine/Ketsji/KX_EmptyObject.h +++ b/source/gameengine/Ketsji/KX_EmptyObject.h @@ -37,7 +37,13 @@ public: KX_GameObject(sgReplicationInfo,callbacks) {}; virtual ~KX_EmptyObject(); - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_EMPTYOBJECT diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h index 8c899a4db0b..52b9b3be5af 100644 --- a/source/gameengine/Ketsji/KX_IInterpolator.h +++ b/source/gameengine/Ketsji/KX_IInterpolator.h @@ -31,11 +31,22 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_IInterpolator { public: virtual ~KX_IInterpolator() {} virtual void Execute(float currentTime) const = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; typedef std::vector T_InterpolatorList; diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index 031b74294ce..68a74c3a364 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -116,6 +116,12 @@ public: m_ipotime = time; m_modified = true; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__IPO_SGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 81c01045071..f9dcf81bca5 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -126,6 +126,13 @@ public: // call from scene graph to update virtual bool Update(double time)=0; void* GetUserData() { return m_userdata;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_IPHYSICSCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h index 6ba685885e9..ec6183b88a1 100644 --- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h @@ -29,11 +29,22 @@ #ifndef KX_ISCALARINTERPOLATOR_H #define KX_ISCALARINTERPOLATOR_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_IScalarInterpolator { public: virtual ~KX_IScalarInterpolator() {} virtual float GetValue(float currentTime) const = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h index 45b3276e98c..f098b0bebf5 100644 --- a/source/gameengine/Ketsji/KX_ISceneConverter.h +++ b/source/gameengine/Ketsji/KX_ISceneConverter.h @@ -32,6 +32,10 @@ #include "STR_String.h" #include "KX_Python.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct Scene; class KX_ISceneConverter @@ -80,6 +84,13 @@ public: virtual bool GetGLSLMaterials()=0; virtual struct Scene* GetBlenderSceneForName(const STR_String& name)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ISCENECONVERTER_H diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h index 204e116e822..deee91f62e8 100644 --- a/source/gameengine/Ketsji/KX_ISystem.h +++ b/source/gameengine/Ketsji/KX_ISystem.h @@ -37,6 +37,10 @@ using namespace std; #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * System Abstraction, needed only for getting some timing stuff from the host. */ @@ -47,6 +51,13 @@ public: virtual ~KX_ISystem() {}; virtual double GetTimeInSeconds()=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index a36b3f163fd..acb9e53df8a 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -190,7 +190,6 @@ private: void DoSound(KX_Scene* scene); public: - KX_KetsjiEngine(class KX_ISystem* system); virtual ~KX_KetsjiEngine(); @@ -396,6 +395,13 @@ protected: bool BeginFrame(); void ClearFrame(); void EndFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_KETSJI_ENGINE 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 diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h index 4d2e258bf94..906c12426eb 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.h +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h @@ -50,6 +50,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_MaterialIpoController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h index 0e43e88fbeb..63c265aa8a7 100644 --- a/source/gameengine/Ketsji/KX_MotionState.h +++ b/source/gameengine/Ketsji/KX_MotionState.h @@ -31,6 +31,10 @@ #include "PHY_IMotionState.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_MotionState : public PHY_IMotionState { class SG_Spatial* m_node; @@ -48,6 +52,12 @@ public: virtual void setWorldOrientation(const float* ori); virtual void calculateWorldTransformations(); + + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_MOTIONSTATE diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h index 6d63dd77683..a32d027be9c 100644 --- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h +++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h @@ -67,6 +67,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_ObColorIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_OBCOLORIPOSGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h index 2bd9f69d824..d8ecc74277c 100644 --- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h +++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Matrix3x3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +private: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 266b4d7e789..dc42bd2f81b 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -35,6 +35,10 @@ #include "RAS_IRasterizer.h" #include "DNA_ID.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct MTFace; struct Material; struct MTex; @@ -57,6 +61,7 @@ private: mutable int m_pass; public: + KX_PolygonMaterial(); void Initialize(const STR_String &texname, Material* ma, diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h index bff0b4201c2..f6c6fa98a0e 100644 --- a/source/gameengine/Ketsji/KX_PositionInterpolator.h +++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Point3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +private: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h index c3084c997a1..cdafc894f6c 100644 --- a/source/gameengine/Ketsji/KX_RayCast.h +++ b/source/gameengine/Ketsji/KX_RayCast.h @@ -89,6 +89,12 @@ public: const MT_Point3& topoint, KX_RayCast& callback); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; template class KX_RayCast::Callback : public KX_RayCast @@ -121,7 +127,13 @@ public: } return self->NeedRayCast(info); } - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h index b816d4d5250..27c9be14d1f 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.h +++ b/source/gameengine/Ketsji/KX_RayEventManager.h @@ -45,6 +45,13 @@ public: m_logicmgr(logicmgr) {} virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_RAYEVENTMGR diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h index c9baf228855..dd4419543a2 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h @@ -59,7 +59,6 @@ class KX_BoneParentRelation : public SG_ParentRelation { public : - /** * Allocate and construct a new KX_SG_BoneParentRelation * on the heap. @@ -101,6 +100,12 @@ private : KX_BoneParentRelation(Bone* bone ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif 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 diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h index 8835c98c184..ca011ab5db0 100644 --- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h @@ -55,6 +55,13 @@ public: private: MT_Scalar* m_target; KX_IScalarInterpolator *m_ipo; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h index a7b5d7e559a..460563d4135 100644 --- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Vector3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h index 0cc34b53736..fe15967f93c 100644 --- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h +++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h @@ -125,6 +125,12 @@ protected: /** Maximum number of measurements. */ unsigned int m_maxNumMeasurements; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_TIME_CATEGORY_LOGGER_H diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h index 0962f02a877..2e73abc75b5 100644 --- a/source/gameengine/Ketsji/KX_TimeLogger.h +++ b/source/gameengine/Ketsji/KX_TimeLogger.h @@ -36,6 +36,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * Stores and manages time measurements. */ @@ -98,6 +102,13 @@ protected: /** State of logging. */ bool m_logging; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_TIME_LOGGER_H diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h index cc77bccfc31..6da37d615a4 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.h +++ b/source/gameengine/Ketsji/KX_TouchEventManager.h @@ -76,6 +76,12 @@ public: SCA_LogicManager* GetLogicManager() { return m_logicmgr;} PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_TOUCHEVENTMANAGER 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 diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h index d90c03d09ee..8622d80a35f 100644 --- a/source/gameengine/Ketsji/KX_WorldIpoController.h +++ b/source/gameengine/Ketsji/KX_WorldIpoController.h @@ -90,6 +90,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_WorldIpoController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_LIGHTIPOSGCONTROLLER_H diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h index 4a47774a762..2a2a909a04d 100644 --- a/source/gameengine/Network/NG_NetworkDeviceInterface.h +++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h @@ -76,6 +76,13 @@ public: */ virtual STR_String GetNetworkVersion(void)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKDEVICEINTERFACE_H diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h index 687c8120eca..a2f76dc1fae 100644 --- a/source/gameengine/Network/NG_NetworkMessage.h +++ b/source/gameengine/Network/NG_NetworkMessage.h @@ -32,6 +32,10 @@ #include "STR_HashedString.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class NG_NetworkMessage { static int s_nextID; @@ -122,6 +126,13 @@ public: int GetMessageID() { return m_uniqueMessageID; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKMESSAGE_H diff --git a/source/gameengine/Network/NG_NetworkObject.h b/source/gameengine/Network/NG_NetworkObject.h index c01d76a47fc..4bf636bf011 100644 --- a/source/gameengine/Network/NG_NetworkObject.h +++ b/source/gameengine/Network/NG_NetworkObject.h @@ -32,6 +32,10 @@ #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class NG_NetworkObject { STR_String m_name; @@ -39,6 +43,13 @@ public: NG_NetworkObject(); ~NG_NetworkObject(); const STR_String& GetName(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKOBJECT_H diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h index fc6367c3526..d5d6e8e0534 100644 --- a/source/gameengine/Network/NG_NetworkScene.h +++ b/source/gameengine/Network/NG_NetworkScene.h @@ -34,6 +34,10 @@ #include "STR_HashedString.h" #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + //MSVC defines SendMessage as a win api function, even though we aren't using it #ifdef SendMessage #undef SendMessage @@ -52,7 +56,7 @@ class NG_NetworkScene TMessageMap m_messagesBySenderName; TMessageMap m_messagesBySubject; -public: +public: NG_NetworkScene(NG_NetworkDeviceInterface *nic); ~NG_NetworkScene(); @@ -100,6 +104,13 @@ protected: * @param map Message map with messages. */ void ClearMessageMap(TMessageMap& map); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__NG_NETWORKSCENE_H diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h index b0626f902c2..99885eb99ee 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.h +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -75,6 +75,12 @@ private: btBroadphaseProxy* m_handle; void* m_newClientInfo; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //BULLET2_PHYSICSCONTROLLER_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 }; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index bc5491e00cc..e087eac32c5 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -275,7 +275,11 @@ protected: bool m_scalingPropagated; - +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //CCDPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 8dbd137f9de..28440ebdad4 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -93,6 +93,12 @@ public: return 0.f; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //_DUMMYPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h index 45e93f9d24e..a053a9679b8 100644 --- a/source/gameengine/Physics/common/PHY_IController.h +++ b/source/gameengine/Physics/common/PHY_IController.h @@ -31,7 +31,9 @@ #include "PHY_DynamicTypes.h" - +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif /** PHY_IController is the abstract simplified Interface to objects @@ -41,12 +43,17 @@ class PHY_IController { public: - virtual ~PHY_IController(); // clientinfo for raycasts for example virtual void* getNewClientInfo()=0; virtual void setNewClientInfo(void* clientinfo)=0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_ICONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h index 470d42cb84a..aae971ff42a 100644 --- a/source/gameengine/Physics/common/PHY_IGraphicController.h +++ b/source/gameengine/Physics/common/PHY_IGraphicController.h @@ -39,9 +39,7 @@ */ class PHY_IGraphicController : public PHY_IController { - public: - virtual ~PHY_IGraphicController(); /** SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') @@ -53,6 +51,11 @@ class PHY_IGraphicController : public PHY_IController virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;} + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IGRAPHICCONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h index f7bcbd4f2d0..c3d01c010ff 100644 --- a/source/gameengine/Physics/common/PHY_IMotionState.h +++ b/source/gameengine/Physics/common/PHY_IMotionState.h @@ -29,6 +29,10 @@ #ifndef PHY__MOTIONSTATE_H #define PHY__MOTIONSTATE_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** PHY_IMotionState is the Interface to explicitly synchronize the world transformation. Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided. @@ -36,8 +40,7 @@ class PHY_IMotionState { - public: - + public: virtual ~PHY_IMotionState(); virtual void getWorldPosition(float& posX,float& posY,float& posZ)=0; @@ -52,6 +55,13 @@ class PHY_IMotionState virtual void calculateWorldTransformations()=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY__MOTIONSTATE_H diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h index d7b8cb0b54f..664e5fddd83 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsController.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h @@ -41,7 +41,6 @@ class PHY_IPhysicsController : public PHY_IController { public: - virtual ~PHY_IPhysicsController(); /** SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') @@ -99,6 +98,11 @@ class PHY_IPhysicsController : public PHY_IController PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IPHYSICSCONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index c76e9d175ce..291dac298dc 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -32,6 +32,11 @@ #include #include "PHY_DynamicTypes.h" + +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class PHY_IVehicle; class RAS_MeshObject; class PHY_IPhysicsController; @@ -76,6 +81,12 @@ public: m_faceNormal(faceNormal) { } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -160,6 +171,13 @@ class PHY_IPhysicsEnvironment virtual void setConstraintParam(int constraintId,int param,float value,float value1) = 0; virtual float getConstraintParam(int constraintId,int param) = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //_IPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/common/PHY_IVehicle.h b/source/gameengine/Physics/common/PHY_IVehicle.h index 498df0dd840..261bae480f5 100644 --- a/source/gameengine/Physics/common/PHY_IVehicle.h +++ b/source/gameengine/Physics/common/PHY_IVehicle.h @@ -6,10 +6,13 @@ class PHY_IMotionState; #include "PHY_DynamicTypes.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class PHY_IVehicle { public: - virtual ~PHY_IVehicle(); virtual void AddWheel( @@ -52,6 +55,12 @@ public: virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IVEHICLE_H diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index 6a420a974d4..99d4ea595ab 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -30,6 +30,10 @@ #define MAX_RENDER_PASS 100 +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_2DFilterManager { private: @@ -97,5 +101,12 @@ public: void RenderFilters(RAS_ICanvas* canvas); void EnableFilter(vector& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 2b81ddd3c82..dcac41ab6e9 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -67,6 +67,12 @@ private: RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); void RenderAlphaBuckets(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_BUCKETMANAGER diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 75c0dcd1eeb..6f4cd425c6c 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -37,6 +37,10 @@ #include #include "GEN_Map.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct DerivedMesh; class RAS_MeshObject; @@ -82,6 +86,12 @@ public: protected: class RAS_MeshObject *m_pMesh; bool m_bDynamic; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index 4398e2d00c3..3ae794c430a 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -29,6 +29,10 @@ #ifndef RAS_FRAMINGMANAGER_H #define RAS_FRAMINGMANAGER_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_Rect; /** @@ -55,7 +59,6 @@ class RAS_Rect; class RAS_FrameSettings { public : - /** * enum defining the policy to use * in each axis. @@ -154,6 +157,13 @@ private : float m_bar_b; unsigned int m_design_aspect_width; unsigned int m_design_aspect_height; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; struct RAS_FrameFrustum @@ -274,6 +284,13 @@ private : RAS_FramingManager( const RAS_FramingManager & ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index f3f817a943d..dae4fb3f4d2 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -33,6 +33,10 @@ * 2D rendering device context. The connection from 3d rendercontext to 2d surface. */ +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_Rect; @@ -173,6 +177,13 @@ public: MakeScreenShot( const char* filename )=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_ICANVAS diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index a01196ef307..af909dfa731 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -38,6 +38,10 @@ #include "MT_Vector3.h" #include "STR_HashedString.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_IRasterizer; struct MTFace; struct Material; @@ -82,7 +86,6 @@ protected: unsigned int m_flag;//MaterialProps int m_multimode; // sum of values public: - MT_Vector3 m_diffuse; float m_shininess; MT_Vector3 m_specular; @@ -165,6 +168,13 @@ public: * PreCalculate texture gen */ virtual void OnConstruction(int layer){} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; inline bool operator ==( const RAS_IPolyMaterial & rhs,const RAS_IPolyMaterial & lhs) diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index dc8c3c1ebf8..05406413941 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -43,6 +43,10 @@ #include using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_ICanvas; class RAS_IPolyMaterial; @@ -57,7 +61,6 @@ typedef vector< KX_IndexArray* > vecIndexArrays; class RAS_IRasterizer { public: - RAS_IRasterizer(RAS_ICanvas* canv){}; virtual ~RAS_IRasterizer(){}; /** @@ -407,6 +410,13 @@ public: virtual void SetBlendingMode(int blendmode)=0; virtual void SetFrontFace(bool ccw)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_IRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 52f6397cf6c..5d52ddc9688 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -36,6 +36,10 @@ #include #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_IPolyMaterial; struct RAS_LightObject; @@ -180,6 +184,13 @@ public: virtual void Render2DFilters(RAS_ICanvas* canvas)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_IRENDERTOOLS diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 8db75b8b735..207763392b2 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -169,6 +169,13 @@ public: bool IsCulled() { return m_bCulled; } #endif void SetCulled(bool culled) { m_bCulled = culled; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /* Used by RAS_MeshObject, to point to it's slots in a bucket */ @@ -179,6 +186,13 @@ public: RAS_MeshSlot *m_baseslot; class RAS_MaterialBucket *m_bucket; GEN_Map m_slots; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /* Contains a list of display arrays with the same material, @@ -232,6 +246,12 @@ private: RAS_IPolyMaterial* m_material; SG_DList m_activeMeshSlotsHead; // only those which must be rendered + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_MATERIAL_BUCKET diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index f34546a8ff7..1738423c4f3 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -173,6 +173,13 @@ public: }; vector > m_sharedvertex_map; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_MESHOBJECT diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index fe358808e4a..cff48081f02 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -66,6 +66,13 @@ public: virtual void SetDrawingMode(int drawingmode); virtual bool QueryLists(){return true;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index e3422394e9e..db0f97bf46f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -289,6 +289,13 @@ public: virtual void SetBlendingMode(int blendmode); virtual void SetFrontFace(bool ccw); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_OPENGLRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h index 766bbfbed0e..6112c1a4d98 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h @@ -58,6 +58,12 @@ private: //virtual bool QueryArrays(){return true;} //virtual bool QueryLists(){return m_Lock;} + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_VERTEXARRAYOPENGLRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h index 41eaa6bdd4a..a5b77738026 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.h +++ b/source/gameengine/Rasterizer/RAS_Polygon.h @@ -35,6 +35,10 @@ #include using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /* polygon flags */ class RAS_Polygon @@ -85,6 +89,12 @@ public: RAS_MaterialBucket* GetMaterial(); RAS_DisplayArray* GetDisplayArray(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h index 4cd0c636cfd..ca7435673c9 100644 --- a/source/gameengine/Rasterizer/RAS_Rect.h +++ b/source/gameengine/Rasterizer/RAS_Rect.h @@ -30,6 +30,10 @@ #ifndef _RAS_RECT #define _RAS_RECT +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * @section interface class. * RAS_Rect just encodes a simple rectangle. @@ -89,6 +93,12 @@ public: { m_y2 = y2; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // _RAS_RECT diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index 811867f3579..b93078f4712 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -34,6 +34,10 @@ #include "MT_Point2.h" #include "MT_Transform.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + static MT_Point3 g_pt3; static MT_Point2 g_pt2; @@ -134,6 +138,12 @@ public: // compare two vertices, to test if they can be shared, used for // splitting up based on uv's, colors, etc bool closeTo(const RAS_TexVert* other); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_TEXVERT diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index c39ad268e25..8dbb9869dae 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -38,6 +38,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SG_Node; /** @@ -128,6 +132,12 @@ public: friend class SG_Tree; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __SG_BBOX_H__ */ diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index c32885b915f..db9d7bdb464 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -40,6 +40,12 @@ class SG_Controller { public: + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif + SG_Controller( ) : m_pObject(NULL) { diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index 7bef13cc9e3..3e17fb55dc0 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -31,6 +31,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * Double circular linked list */ @@ -155,6 +159,13 @@ public: { return this; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_DLIST diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index 8f448a0e890..23e6c1e9c99 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -160,8 +160,6 @@ private : SGControllerList m_SGcontrollers; public: - - virtual ~SG_IObject(); @@ -338,6 +336,11 @@ protected : ); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_IOBJECT diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 7c6ef92f670..4281bcd11f6 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -40,7 +40,6 @@ typedef std::vector NodeList; class SG_Node : public SG_Spatial { public: - SG_Node( void* clientobj, void* clientinfo, @@ -260,6 +259,12 @@ private: */ SG_Node* m_SGparent; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_NODE_H diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 8f45df09b27..a6a43c19115 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -55,7 +55,6 @@ class SG_Spatial; class SG_ParentRelation { public : - /** * Update the childs local and global coordinates * based upon the parents global coordinates. @@ -128,6 +127,13 @@ protected : SG_ParentRelation( const SG_ParentRelation & ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index d8afc33ea4f..6399111d80b 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -151,6 +151,13 @@ public: { return m_bqlink; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_QLIST diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index 6e274487c9d..a818c8c81f7 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -66,7 +66,6 @@ protected: bool m_ogldirty; // true if the openGL matrix for this object must be recomputed public: - inline void ClearModified() { m_modified = false; @@ -284,6 +283,12 @@ protected: bool& parentUpdated ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_SPATIAL_H diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h index 4741af83aae..6ca3307920e 100644 --- a/source/gameengine/SceneGraph/SG_Tree.h +++ b/source/gameengine/SceneGraph/SG_Tree.h @@ -111,6 +111,13 @@ public: } }; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -148,6 +155,12 @@ public: SG_Tree* MakeTree(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __SG_BBOX_H__ */ -- cgit v1.2.3