From cc0784c1b9c4d813837dedddd5b2b4c52fe291f0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Jun 2012 09:14:37 +0000 Subject: optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. --- source/gameengine/BlenderRoutines/KX_BlenderCanvas.h | 4 +--- .../gameengine/BlenderRoutines/KX_BlenderInputDevice.h | 4 +--- .../BlenderRoutines/KX_BlenderKeyboardDevice.h | 4 +--- .../gameengine/BlenderRoutines/KX_BlenderMouseDevice.h | 4 +--- .../gameengine/BlenderRoutines/KX_BlenderRenderTools.h | 4 +--- source/gameengine/BlenderRoutines/KX_BlenderSystem.h | 4 +--- source/gameengine/Converter/BL_DeformableGameObject.h | 4 +--- source/gameengine/Converter/BL_MeshDeformer.h | 4 +--- source/gameengine/Converter/BL_ModifierDeformer.h | 4 +--- source/gameengine/Converter/BL_ShapeDeformer.h | 4 +--- source/gameengine/Converter/BL_SkinDeformer.h | 4 +--- source/gameengine/Converter/BlenderWorldInfo.h | 4 +--- .../gameengine/Converter/KX_BlenderScalarInterpolator.h | 8 ++------ source/gameengine/Converter/KX_BlenderSceneConverter.h | 4 +--- source/gameengine/Converter/KX_SoftBodyDeformer.h | 4 +--- source/gameengine/Expressions/BoolValue.h | 5 +---- source/gameengine/Expressions/ConstExpr.h | 4 +--- source/gameengine/Expressions/EmptyValue.h | 4 +--- source/gameengine/Expressions/ErrorValue.h | 4 +--- source/gameengine/Expressions/Expression.h | 8 ++------ source/gameengine/Expressions/FloatValue.h | 4 +--- source/gameengine/Expressions/IdentifierExpr.h | 4 +--- source/gameengine/Expressions/IfExpr.h | 4 +--- source/gameengine/Expressions/InputParser.h | 4 +--- source/gameengine/Expressions/IntValue.h | 4 +--- source/gameengine/Expressions/KX_HashedPtr.h | 4 +--- source/gameengine/Expressions/Operator1Expr.h | 4 +--- source/gameengine/Expressions/Operator2Expr.h | 4 +--- source/gameengine/Expressions/PyObjectPlus.h | 16 +++------------- source/gameengine/Expressions/StringValue.h | 4 +--- source/gameengine/Expressions/Value.h | 9 ++------- source/gameengine/Expressions/VectorValue.h | 4 +--- source/gameengine/Expressions/VoidValue.h | 4 +--- source/gameengine/GameLogic/SCA_ActuatorEventManager.h | 4 +--- source/gameengine/GameLogic/SCA_AlwaysEventManager.h | 4 +--- source/gameengine/GameLogic/SCA_BasicEventManager.h | 4 +--- source/gameengine/GameLogic/SCA_EventManager.h | 4 +--- source/gameengine/GameLogic/SCA_ExpressionController.h | 4 +--- source/gameengine/GameLogic/SCA_IActuator.h | 4 +--- source/gameengine/GameLogic/SCA_IInputDevice.h | 4 +--- source/gameengine/GameLogic/SCA_IScene.h | 4 +--- source/gameengine/GameLogic/SCA_JoystickManager.h | 4 +--- source/gameengine/GameLogic/SCA_KeyboardManager.h | 4 +--- source/gameengine/GameLogic/SCA_LogicManager.h | 4 +--- source/gameengine/GameLogic/SCA_MouseManager.h | 4 +--- source/gameengine/GameLogic/SCA_PropertyEventManager.h | 4 +--- source/gameengine/GameLogic/SCA_RandomEventManager.h | 4 +--- source/gameengine/GameLogic/SCA_RandomNumberGenerator.h | 4 +--- source/gameengine/GameLogic/SCA_TimeEventManager.h | 4 +--- source/gameengine/Ketsji/BL_Action.h | 4 +--- source/gameengine/Ketsji/BL_ActionManager.h | 4 +--- source/gameengine/Ketsji/BL_BlenderShader.h | 4 +--- source/gameengine/Ketsji/BL_Material.h | 4 +--- source/gameengine/Ketsji/BL_Shader.h | 12 +++--------- source/gameengine/Ketsji/BL_Texture.h | 4 +--- source/gameengine/Ketsji/KX_BulletPhysicsController.h | 4 +--- source/gameengine/Ketsji/KX_CameraIpoSGController.h | 4 +--- source/gameengine/Ketsji/KX_ClientObjectInfo.h | 4 +--- source/gameengine/Ketsji/KX_Dome.h | 4 +--- source/gameengine/Ketsji/KX_EmptyObject.h | 4 +--- source/gameengine/Ketsji/KX_FontObject.h | 6 +----- source/gameengine/Ketsji/KX_IInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_IPO_SGController.h | 7 +++---- source/gameengine/Ketsji/KX_IPhysicsController.h | 4 +--- source/gameengine/Ketsji/KX_IScalarInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_ISceneConverter.h | 4 +--- source/gameengine/Ketsji/KX_ISystem.h | 4 +--- source/gameengine/Ketsji/KX_KetsjiEngine.h | 4 +--- source/gameengine/Ketsji/KX_LightIpoSGController.h | 4 +--- source/gameengine/Ketsji/KX_MaterialIpoController.h | 4 +--- source/gameengine/Ketsji/KX_MotionState.h | 3 +-- source/gameengine/Ketsji/KX_ObColorIpoSGController.h | 4 +--- source/gameengine/Ketsji/KX_OrientationInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_PositionInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_RayCast.h | 8 ++------ source/gameengine/Ketsji/KX_RayEventManager.h | 4 +--- .../Ketsji/KX_SG_BoneParentNodeRelationship.h | 4 +--- source/gameengine/Ketsji/KX_SG_NodeRelationships.h | 12 +++--------- source/gameengine/Ketsji/KX_ScalarInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_ScalingInterpolator.h | 4 +--- source/gameengine/Ketsji/KX_TimeCategoryLogger.h | 4 +--- source/gameengine/Ketsji/KX_TimeLogger.h | 4 +--- source/gameengine/Ketsji/KX_TouchEventManager.h | 4 +--- source/gameengine/Ketsji/KX_WorldInfo.h | 4 +--- source/gameengine/Ketsji/KX_WorldIpoController.h | 4 +--- source/gameengine/Network/NG_NetworkDeviceInterface.h | 4 +--- source/gameengine/Network/NG_NetworkMessage.h | 4 +--- source/gameengine/Network/NG_NetworkObject.h | 4 +--- source/gameengine/Network/NG_NetworkScene.h | 4 +--- source/gameengine/Physics/Bullet/CcdGraphicController.h | 4 +--- source/gameengine/Physics/Bullet/CcdPhysicsController.h | 12 +++--------- .../gameengine/Physics/Bullet/CcdPhysicsEnvironment.h | 4 +--- .../gameengine/Physics/Dummy/DummyPhysicsEnvironment.h | 4 +--- source/gameengine/Physics/common/PHY_IController.h | 4 +--- .../gameengine/Physics/common/PHY_IGraphicController.h | 3 +-- source/gameengine/Physics/common/PHY_IMotionState.h | 4 +--- .../gameengine/Physics/common/PHY_IPhysicsController.h | 5 ++--- .../gameengine/Physics/common/PHY_IPhysicsEnvironment.h | 14 ++++++-------- source/gameengine/Physics/common/PHY_IVehicle.h | 4 +--- source/gameengine/Rasterizer/RAS_2DFilterManager.h | 8 +++----- source/gameengine/Rasterizer/RAS_BucketManager.h | 5 ++--- source/gameengine/Rasterizer/RAS_Deformer.h | 5 ++--- source/gameengine/Rasterizer/RAS_FramingManager.h | 11 +++-------- source/gameengine/Rasterizer/RAS_ICanvas.h | 7 +++---- source/gameengine/Rasterizer/RAS_IPolygonMaterial.h | 8 +++----- source/gameengine/Rasterizer/RAS_IRasterizer.h | 8 +++----- source/gameengine/Rasterizer/RAS_IRenderTools.h | 8 +++----- source/gameengine/Rasterizer/RAS_MaterialBucket.h | 17 +++++------------ source/gameengine/Rasterizer/RAS_MeshObject.h | 8 +++----- .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 8 +++----- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 8 +++----- .../RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h | 4 +--- source/gameengine/Rasterizer/RAS_Polygon.h | 7 +++---- source/gameengine/Rasterizer/RAS_Rect.h | 7 +++---- source/gameengine/Rasterizer/RAS_TexVert.h | 7 +++---- source/gameengine/SceneGraph/SG_BBox.h | 4 +--- source/gameengine/SceneGraph/SG_Controller.h | 9 +++------ source/gameengine/SceneGraph/SG_DList.h | 4 +--- source/gameengine/SceneGraph/SG_IObject.h | 4 +--- source/gameengine/SceneGraph/SG_Node.h | 4 +--- source/gameengine/SceneGraph/SG_ParentRelation.h | 4 +--- source/gameengine/SceneGraph/SG_QList.h | 4 +--- source/gameengine/SceneGraph/SG_Spatial.h | 4 +--- source/gameengine/SceneGraph/SG_Tree.h | 8 ++------ 124 files changed, 177 insertions(+), 458 deletions(-) (limited to 'source/gameengine') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index a9a12f5a9e0..ee7997abb39 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -194,9 +194,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderCanvas") #endif }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h index 18f163d7274..43870d9030d 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h @@ -72,9 +72,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); } - void operator delete(void *mem) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_BlenderInputDevice") #endif }; #endif //__KX_BLENDERINPUTDEVICE_H__ diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h index 43296fc9760..e9140efce01 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h @@ -55,9 +55,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); } - void operator delete(void *mem) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderKeyboardDevice") #endif }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h index 1c54b2fc000..0571cafd7a1 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h @@ -51,9 +51,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); } - void operator delete(void *mem) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderMouseDevice") #endif }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h index a470e029758..a229c9f34e6 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h @@ -108,9 +108,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderRenderTools") #endif }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h index 2674c9a7aa1..a8e033ed47b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h @@ -49,9 +49,7 @@ public: virtual double GetTimeInSeconds(); #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderSystem") #endif }; diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index d0fe741672d..61477fb1cac 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -100,9 +100,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_DeformableGameObject") #endif }; diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index b7d527d83eb..c73e4efd245 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -90,9 +90,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_MeshDeformer") #endif }; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index 163b2dd108f..b4827b1bee4 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -107,9 +107,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ModifierDeformer") #endif }; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 6b55d5b26f9..efc1b546666 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -79,9 +79,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ShapeDeformer") #endif }; diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 8e3d5851573..48c3c3e6186 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -116,9 +116,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_SkinDeformer") #endif }; diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h index e6f274b777e..e00eb99e73f 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.h +++ b/source/gameengine/Converter/BlenderWorldInfo.h @@ -100,9 +100,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BlenderWorldInfo") #endif }; diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index cd18bd8c1d6..bc5a6eeef85 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -55,9 +55,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ScalarInterpolator") #endif }; @@ -71,9 +69,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_InterpolatorList") #endif }; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 258fb1ebdcc..906e3fed111 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -191,9 +191,7 @@ public: #endif #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderSceneConverter") #endif }; diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.h b/source/gameengine/Converter/KX_SoftBodyDeformer.h index 5235c91ce89..d692d45eb18 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.h +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.h @@ -93,9 +93,7 @@ protected: //class RAS_MeshObject *m_pMesh; #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ShapeDeformer") #endif }; diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index 48238264f1b..09e931ea661 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -56,11 +56,8 @@ public: private: bool m_bool; - #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CBoolValue") #endif }; diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h index 30b830cb92c..86d411cef26 100644 --- a/source/gameengine/Expressions/ConstExpr.h +++ b/source/gameengine/Expressions/ConstExpr.h @@ -47,9 +47,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CConstExpr") #endif }; diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h index 73946da6705..54920359f3f 100644 --- a/source/gameengine/Expressions/EmptyValue.h +++ b/source/gameengine/Expressions/EmptyValue.h @@ -41,9 +41,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CEmptyValue") #endif }; diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h index 484d135f406..12bc7c7ffcb 100644 --- a/source/gameengine/Expressions/ErrorValue.h +++ b/source/gameengine/Expressions/ErrorValue.h @@ -39,9 +39,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CErrorValue") #endif }; diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 8a4ba8bb7e2..5f5db505331 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -74,9 +74,7 @@ class CBrokenLinkInfo #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CBrokenLinkInfo") #endif }; @@ -144,9 +142,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CExpression") #endif }; diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index 75b2202eb7e..59311e5d373 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -50,9 +50,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CFloatValue") #endif }; diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h index 632a1e0a6d9..58e75c4b02e 100644 --- a/source/gameengine/Expressions/IdentifierExpr.h +++ b/source/gameengine/Expressions/IdentifierExpr.h @@ -52,9 +52,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIdentifierExpr") #endif }; diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h index c0caa7f3e17..f8ed81168d0 100644 --- a/source/gameengine/Expressions/IfExpr.h +++ b/source/gameengine/Expressions/IfExpr.h @@ -51,9 +51,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIfExpr") #endif }; diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h index 085e6870429..6dfeff55105 100644 --- a/source/gameengine/Expressions/InputParser.h +++ b/source/gameengine/Expressions/InputParser.h @@ -110,9 +110,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CParser") #endif }; diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 733ee8bfa4e..e728467cc4e 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -65,9 +65,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CIntValue") #endif }; diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h index edb68f2861d..ffc6ff647d5 100644 --- a/source/gameengine/Expressions/KX_HashedPtr.h +++ b/source/gameengine/Expressions/KX_HashedPtr.h @@ -54,9 +54,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CHashedPtr") #endif }; diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h index 9815ce16e95..13a1b16500a 100644 --- a/source/gameengine/Expressions/Operator1Expr.h +++ b/source/gameengine/Expressions/Operator1Expr.h @@ -52,9 +52,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:") #endif }; diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h index 8b1c5523a2f..23272930131 100644 --- a/source/gameengine/Expressions/Operator2Expr.h +++ b/source/gameengine/Expressions/Operator2Expr.h @@ -58,9 +58,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:COperator2Expr") #endif }; diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 124a8e28f57..af8acaa993f 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -534,21 +534,11 @@ typedef PyTypeObject *PyParentObject; /* Define the PyParent Object */ #ifdef WITH_CXX_GUARDEDALLOC #define Py_Header \ public: \ - void *operator new(size_t num_bytes) { \ - return MEM_mallocN(num_bytes, "GE:PyObjectPlus"); \ - } \ - void operator delete( void *mem ) { \ - MEM_freeN(mem); \ - } \ + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PyObjectPlus") \ + #define Py_HeaderPtr \ -public: \ - void *operator new(size_t num_bytes) { \ - return MEM_mallocN(num_bytes, "GE:PyObjectPlusPtr"); \ - } \ - void operator delete( void *mem ) { \ - MEM_freeN(mem); \ - } \ + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PyObjectPlusPtr") \ #else // WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index 931858b7eed..aa4a1a0bb00 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -53,9 +53,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CStringValue") #endif }; diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 261f5244f21..e3b52e80ba6 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -164,9 +164,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CAction") #endif }; @@ -436,11 +434,8 @@ public: protected: STR_String m_strNewName; // Identification - #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CPropValue") #endif }; diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h index 5d0e0c0ddb2..b7afa61d4dd 100644 --- a/source/gameengine/Expressions/VectorValue.h +++ b/source/gameengine/Expressions/VectorValue.h @@ -86,9 +86,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CVectorValue") #endif }; diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index 8e2545b309d..5599b226a60 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -66,9 +66,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CVoidValue") #endif }; diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h index b91e6f872a2..dee9ea4e8ba 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -49,9 +49,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_ActuatorEventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h index 21ac55d36a4..cf4063fba1f 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h @@ -43,9 +43,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_AlwaysEventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_BasicEventManager.h b/source/gameengine/GameLogic/SCA_BasicEventManager.h index 9d08a7785e2..24206e46a61 100644 --- a/source/gameengine/GameLogic/SCA_BasicEventManager.h +++ b/source/gameengine/GameLogic/SCA_BasicEventManager.h @@ -50,9 +50,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_BasicEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_BasicEventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 933fdc5190a..83322fe8243 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -84,9 +84,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_EventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 47401ea5807..06edc83ab96 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -59,9 +59,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_ExpressionController") #endif }; diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 211a25b84c8..801483bb882 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -160,9 +160,7 @@ public: bool IsType(KX_ACTUATOR_TYPE type) { return m_type == type; } #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_IActuator") #endif }; diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h index 443faef6338..01f525f8eb7 100644 --- a/source/gameengine/GameLogic/SCA_IInputDevice.h +++ b/source/gameengine/GameLogic/SCA_IInputDevice.h @@ -316,9 +316,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); } - void operator delete(void *mem) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_InputEvent") #endif }; diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h index e7806ea0746..a399e313082 100644 --- a/source/gameengine/GameLogic/SCA_IScene.h +++ b/source/gameengine/GameLogic/SCA_IScene.h @@ -74,9 +74,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_IScene") #endif }; diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h index dcdd667cb1a..60dcaea4ef2 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.h +++ b/source/gameengine/GameLogic/SCA_JoystickManager.h @@ -51,9 +51,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_JoystickManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h index 5706d16ae19..2d9ad45833f 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.h +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h @@ -59,9 +59,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_KeyboardManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 751c03bc712..817f3a1c22a 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -147,9 +147,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_LogicManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h index 4b40ab8a197..60edb2816cb 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.h +++ b/source/gameengine/GameLogic/SCA_MouseManager.h @@ -68,9 +68,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_MouseManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h index 7d5e13f0ae1..7a4ec750484 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h @@ -48,9 +48,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_PropertyEventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h index 7205363a3ee..b46899b1355 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.h +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h @@ -47,9 +47,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_RandomEventManager") #endif }; diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h index 8f546b37ec8..10818cb4e8f 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h @@ -77,9 +77,7 @@ class SCA_RandomNumberGenerator { #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_RandomNumberGenerator") #endif }; diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h index 7c813785b9c..092cf016370 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.h +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h @@ -55,9 +55,7 @@ public: vector GetTimeValues(); #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SCA_TimeEventManager") #endif }; diff --git a/source/gameengine/Ketsji/BL_Action.h b/source/gameengine/Ketsji/BL_Action.h index e5e325a2ba0..ab2adf7fe34 100644 --- a/source/gameengine/Ketsji/BL_Action.h +++ b/source/gameengine/Ketsji/BL_Action.h @@ -132,9 +132,7 @@ public: }; #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Action"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Action") #endif }; diff --git a/source/gameengine/Ketsji/BL_ActionManager.h b/source/gameengine/Ketsji/BL_ActionManager.h index d4351e3c704..dbdaa6652ad 100644 --- a/source/gameengine/Ketsji/BL_ActionManager.h +++ b/source/gameengine/Ketsji/BL_ActionManager.h @@ -94,9 +94,7 @@ public: void Update(float); #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ActionManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ActionManager") #endif }; diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index d309b1236fc..f23dbfdf3a5 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -97,9 +97,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_BlenderShader") #endif }; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 70fd640a07e..b67bd95f878 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -110,9 +110,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Material") #endif }; diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 47221365816..2bb094f12ee 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -32,9 +32,7 @@ public: int mLoc; // Sampler location #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Sampler") #endif }; @@ -79,9 +77,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Uniform") #endif }; @@ -104,9 +100,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_DefUniform") #endif }; diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h index 3c60cad4fbf..2673be2bc42 100644 --- a/source/gameengine/Ketsji/BL_Texture.h +++ b/source/gameengine/Ketsji/BL_Texture.h @@ -74,9 +74,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_Texture") #endif }; diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 5fcd591d822..71e806686ca 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -92,9 +92,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BulletPhysicsController") #endif }; diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h index f24d0942290..06058760332 100644 --- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h +++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h @@ -90,9 +90,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_CameraIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 1a94c39441f..6fd1271160a 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -80,9 +80,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ClientObjectInfo") #endif }; diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 125df573893..24177af5d60 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -191,9 +191,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_Dome") #endif }; diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h index 7ad9984888d..b99f44c38c5 100644 --- a/source/gameengine/Ketsji/KX_EmptyObject.h +++ b/source/gameengine/Ketsji/KX_EmptyObject.h @@ -43,9 +43,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_EmptyObject") #endif }; diff --git a/source/gameengine/Ketsji/KX_FontObject.h b/source/gameengine/Ketsji/KX_FontObject.h index 30fe89162c0..170c9977296 100644 --- a/source/gameengine/Ketsji/KX_FontObject.h +++ b/source/gameengine/Ketsji/KX_FontObject.h @@ -69,12 +69,8 @@ protected: class RAS_IRenderTools* m_rendertools; //needed for drawing routine -#if 0 // WHY COMMENTED? - campbell #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_FontObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } -#endif + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_FontObject") #endif #ifdef WITH_PYTHON diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h index 2e30d77f8e5..6ca44e1f6e5 100644 --- a/source/gameengine/Ketsji/KX_IInterpolator.h +++ b/source/gameengine/Ketsji/KX_IInterpolator.h @@ -46,9 +46,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index 3abcaa3a39e..266b89ff969 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -119,11 +119,10 @@ public: m_ipotime = time; m_modified = true; } - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 528bf00d574..dd34549c1fb 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -141,9 +141,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IPhysicsController") #endif }; diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h index 72842f311c9..2b5aefccfe7 100644 --- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h @@ -44,9 +44,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_IScalarInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h index 50390005f2b..919ae1d6de5 100644 --- a/source/gameengine/Ketsji/KX_ISceneConverter.h +++ b/source/gameengine/Ketsji/KX_ISceneConverter.h @@ -89,9 +89,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ISceneConverter") #endif }; diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h index 4a6f7223d0a..4ba71f8d239 100644 --- a/source/gameengine/Ketsji/KX_ISystem.h +++ b/source/gameengine/Ketsji/KX_ISystem.h @@ -55,9 +55,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ISystem") #endif }; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index f9c6d59b668..b3bef016b0f 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -443,9 +443,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_KetsjiEngine") #endif }; diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h index 15591bfa981..3a3a9677b04 100644 --- a/source/gameengine/Ketsji/KX_LightIpoSGController.h +++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h @@ -98,9 +98,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_LightIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h index 11d92925a02..ee5546641c2 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.h +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h @@ -58,9 +58,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_MaterialIpoController") #endif }; diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h index 02470f88c5e..3bead93cbda 100644 --- a/source/gameengine/Ketsji/KX_MotionState.h +++ b/source/gameengine/Ketsji/KX_MotionState.h @@ -58,8 +58,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_MotionState") #endif }; diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h index d2f4c69bf47..9a9b3dac098 100644 --- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h +++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h @@ -73,9 +73,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ObColorIpoSGController") #endif }; diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h index 1a4ed534d16..59014b70174 100644 --- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h +++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -private: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_OrientationInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h index ef5dfc8ac6b..b5ab053bb0e 100644 --- a/source/gameengine/Ketsji/KX_PositionInterpolator.h +++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -private: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_PositionInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h index 814443f5c64..544080f31d0 100644 --- a/source/gameengine/Ketsji/KX_RayCast.h +++ b/source/gameengine/Ketsji/KX_RayCast.h @@ -96,9 +96,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayCast") #endif }; @@ -135,9 +133,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayCast::Callback") #endif }; diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h index fee2fe53227..f795495d1c9 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.h +++ b/source/gameengine/Ketsji/KX_RayEventManager.h @@ -46,9 +46,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_RayEventManager") #endif }; diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h index 734f82731b8..76fefdebe08 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h @@ -89,9 +89,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BoneParentRelation") #endif }; diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h index 44864c87cd7..b5ab5302910 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h @@ -88,9 +88,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_NormalParentRelation") #endif }; @@ -145,9 +143,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_VertexParentRelation") #endif }; @@ -228,9 +224,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_SlowParentRelation") #endif }; diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h index d08a32ce0aa..5d8c3163376 100644 --- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h @@ -61,9 +61,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ScalarInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h index ae8b25f9185..52b6d0cf8cc 100644 --- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h @@ -56,9 +56,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_ScalingInterpolator") #endif }; diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h index 62b74871603..ea780739695 100644 --- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h +++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h @@ -129,9 +129,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TimeCategoryLogger") #endif }; diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h index b2336c2c512..83c934ea81b 100644 --- a/source/gameengine/Ketsji/KX_TimeLogger.h +++ b/source/gameengine/Ketsji/KX_TimeLogger.h @@ -107,9 +107,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TimeLogger") #endif }; diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h index 38286cba9aa..d9a0164fd05 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.h +++ b/source/gameengine/Ketsji/KX_TouchEventManager.h @@ -81,9 +81,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_TouchEventManager") #endif }; diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h index cb4e9de50c2..e4a73873fa1 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.h +++ b/source/gameengine/Ketsji/KX_WorldInfo.h @@ -70,9 +70,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_WorldInfo") #endif }; diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h index 9578130b51e..409b1fec321 100644 --- a/source/gameengine/Ketsji/KX_WorldIpoController.h +++ b/source/gameengine/Ketsji/KX_WorldIpoController.h @@ -96,9 +96,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_WorldIpoController") #endif }; diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h index d4a3d12057e..8f903cc64fa 100644 --- a/source/gameengine/Network/NG_NetworkDeviceInterface.h +++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h @@ -75,9 +75,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:NG_NetworkDeviceInterface") #endif }; diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h index 7a55891552f..25e7fd97596 100644 --- a/source/gameengine/Network/NG_NetworkMessage.h +++ b/source/gameengine/Network/NG_NetworkMessage.h @@ -131,9 +131,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:NG_NetworkMessage") #endif }; diff --git a/source/gameengine/Network/NG_NetworkObject.h b/source/gameengine/Network/NG_NetworkObject.h index b7b01bdad06..b9858cd8d43 100644 --- a/source/gameengine/Network/NG_NetworkObject.h +++ b/source/gameengine/Network/NG_NetworkObject.h @@ -48,9 +48,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:NG_NetworkObject") #endif }; diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h index b3ca4df9d50..41ac8ead5e4 100644 --- a/source/gameengine/Network/NG_NetworkScene.h +++ b/source/gameengine/Network/NG_NetworkScene.h @@ -111,9 +111,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:NG_NetworkScene") #endif }; diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h index 07878b7162e..60ff475832b 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.h +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -83,9 +83,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CcdGraphicController") #endif }; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 63c267443aa..09afafbe0a7 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -203,9 +203,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CcdShapeConstructionInfo") #endif }; @@ -625,9 +623,7 @@ protected: } #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CcdPhysicsController") #endif }; @@ -659,9 +655,7 @@ class DefaultMotionState : public PHY_IMotionState #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:DefaultMotionState") #endif }; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 552cca801de..ef1c0873005 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -288,9 +288,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:CcdPhysicsEnvironment") #endif }; diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 8e55c4a0c0f..5183f77176c 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -98,9 +98,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:DummyPhysicsEnvironment") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h index d25af9f898c..239ac3366e1 100644 --- a/source/gameengine/Physics/common/PHY_IController.h +++ b/source/gameengine/Physics/common/PHY_IController.h @@ -56,9 +56,7 @@ class PHY_IController #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IController") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h index 6a94b3d6ea9..af337188818 100644 --- a/source/gameengine/Physics/common/PHY_IGraphicController.h +++ b/source/gameengine/Physics/common/PHY_IGraphicController.h @@ -54,8 +54,7 @@ class PHY_IGraphicController : public PHY_IController virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;} #ifdef WITH_CXX_GUARDEDALLOC - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IController") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h index 77c51ebdb79..2eb2a9f39cf 100644 --- a/source/gameengine/Physics/common/PHY_IMotionState.h +++ b/source/gameengine/Physics/common/PHY_IMotionState.h @@ -61,9 +61,7 @@ class PHY_IMotionState #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IMotionState") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h index 727cbda931d..7eea2a183a1 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsController.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h @@ -102,10 +102,9 @@ class PHY_IPhysicsController : public PHY_IController PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos); + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IPhysicsController") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index a2597f917e3..8fde9e289dc 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -87,11 +87,10 @@ public: m_faceUV(faceUV) { } - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IRayCastFilterCallback") #endif }; @@ -179,11 +178,10 @@ class PHY_IPhysicsEnvironment virtual float getConstraintParam(int constraintId,int param) = 0; virtual void exportFile(const char* filename) {}; - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IPhysicsEnvironment") #endif }; diff --git a/source/gameengine/Physics/common/PHY_IVehicle.h b/source/gameengine/Physics/common/PHY_IVehicle.h index 735ce5a8791..731e22d9f0f 100644 --- a/source/gameengine/Physics/common/PHY_IVehicle.h +++ b/source/gameengine/Physics/common/PHY_IVehicle.h @@ -62,9 +62,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_IVehicle") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index c9af48fe516..93d143dd3ce 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -106,12 +106,10 @@ public: void RenderFilters(RAS_ICanvas* canvas); void EnableFilter(std::vector& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text); - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_2DFilterManager") #endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index dade2ad7c11..2650bc9f722 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -84,10 +84,9 @@ private: void RenderAlphaBuckets(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_BucketManager") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 1e9a792634a..627db2b63fb 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -93,10 +93,9 @@ protected: class RAS_MeshObject *m_pMesh; bool m_bDynamic; + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_Deformer") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index fc5adc97657..6312f83737e 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -163,9 +163,7 @@ private : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_FrameSettings") #endif }; @@ -300,14 +298,11 @@ private : RAS_FramingManager( const RAS_FramingManager & ); - + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_FramingManager") #endif }; #endif - diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index dae70c5c343..713a06845ac 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -217,11 +217,10 @@ public: protected: RAS_MouseState m_mousestate; - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_ICanvas") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 527114b300f..0f89af490d8 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -185,12 +185,10 @@ public: * PreCalculate texture gen */ virtual void OnConstruction(int layer){} - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_IPolyMaterial") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 828ee01d150..d4c19410eb1 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -416,12 +416,10 @@ public: virtual void SetAnisotropicFiltering(short level)=0; virtual short GetAnisotropicFiltering()=0; - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_IRasterizer") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 1d9f7052975..5d3efb8c38a 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -201,12 +201,10 @@ public: virtual void MotionBlur(RAS_IRasterizer* rasterizer)=0; - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_IRenderTools") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index cff4d67d44b..7cf7fee7845 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -175,12 +175,10 @@ public: bool IsCulled() { return m_bCulled; } #endif void SetCulled(bool culled) { m_bCulled = culled; } - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_MeshSlot") #endif }; @@ -195,9 +193,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_MeshMaterial") #endif }; @@ -254,11 +250,8 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_MaterialBucket") #endif }; #endif //__RAS_MATERIAL_BUCKET - diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index ffe2964c058..326110bea57 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -170,12 +170,10 @@ public: }; vector > m_sharedvertex_map; - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_MeshObject") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 0b36bbf3876..808c4f11dd8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -73,12 +73,10 @@ public: virtual void SetDrawingMode(int drawingmode); virtual bool QueryLists(){return true;} - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_ListRasterizer") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 3b4a6c4900c..36f768f6474 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -315,12 +315,10 @@ public: virtual void SetAnisotropicFiltering(short level); virtual short GetAnisotropicFiltering(); - - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_OpenGLRasterizer") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h index d96f390ad74..730431d3108 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h @@ -63,9 +63,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_VAOpenGLRasterizer") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h index a3bd6b600c9..bc70b43286c 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.h +++ b/source/gameengine/Rasterizer/RAS_Polygon.h @@ -93,11 +93,10 @@ public: RAS_MaterialBucket* GetMaterial(); RAS_DisplayArray* GetDisplayArray(); - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_Polygon") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h index c845c2c21bd..cb5f7d47457 100644 --- a/source/gameengine/Rasterizer/RAS_Rect.h +++ b/source/gameengine/Rasterizer/RAS_Rect.h @@ -94,11 +94,10 @@ public: { m_y2 = y2; } - + + #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_Rect") #endif }; diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index f76c6a66c86..15059a9cf12 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -141,11 +141,10 @@ 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(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_TexVert") #endif }; diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index 33e29b85a5f..cd1c523ff40 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -136,9 +136,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_BBox") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index 7100debe632..d82738dbb86 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -43,12 +43,6 @@ class SG_Controller { public: - -#ifdef WITH_CXX_GUARDEDALLOC - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); } - void operator delete( void *mem ) { MEM_freeN(mem); } -#endif - SG_Controller( ) : m_pObject(NULL) { @@ -122,6 +116,9 @@ public: protected: SG_IObject* m_pObject; +#ifdef WITH_CXX_GUARDEDALLOC + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Controller") +#endif }; #endif //__SG_CONTROLLER_H__ diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index 90e3226f227..be1c1fda2f2 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -217,9 +217,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_DList") #endif }; diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index a1d4207e508..c36c984f3d3 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -367,9 +367,7 @@ protected : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_IObject") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 41133495f2e..1d0c0e592e6 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -271,9 +271,7 @@ private: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Node") #endif }; diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 4140563828f..925c0ed2766 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -131,9 +131,7 @@ protected : #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_ParentRelation") #endif }; diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index e1288877b1d..bcc56f05615 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -157,9 +157,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_QList") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index 32f91103369..e456851d183 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -287,9 +287,7 @@ protected: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Spatial") #endif }; diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h index b2cbb227f77..e0d5c712b73 100644 --- a/source/gameengine/SceneGraph/SG_Tree.h +++ b/source/gameengine/SceneGraph/SG_Tree.h @@ -115,9 +115,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_Tree") #endif }; @@ -158,9 +156,7 @@ public: #ifdef WITH_CXX_GUARDEDALLOC -public: - void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); } - void operator delete( void *mem ) { MEM_freeN(mem); } + MEM_CXX_CLASS_ALLOC_FUNCS("GE:SG_TreeFactory") #endif }; -- cgit v1.2.3