BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Aug 2009 15:37:31 +0000 (15:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Aug 2009 15:37:31 +0000 (15:37 +0000)
* off by default.
* new/delete are at the bottom of each class
* python BGE objects have the new/delete in the Py_Header macro.

123 files changed:
source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h
source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
source/gameengine/BlenderRoutines/KX_BlenderSystem.h
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_DeformableGameObject.h
source/gameengine/Converter/BL_MeshDeformer.h
source/gameengine/Converter/BL_ModifierDeformer.h
source/gameengine/Converter/BL_ShapeDeformer.h
source/gameengine/Converter/BL_SkinDeformer.h
source/gameengine/Converter/BL_SkinMeshObject.h
source/gameengine/Converter/BlenderWorldInfo.h
source/gameengine/Converter/KX_BlenderScalarInterpolator.h
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Expressions/BoolValue.h
source/gameengine/Expressions/ConstExpr.h
source/gameengine/Expressions/EmptyValue.h
source/gameengine/Expressions/ErrorValue.h
source/gameengine/Expressions/Expression.h
source/gameengine/Expressions/FloatValue.h
source/gameengine/Expressions/IdentifierExpr.h
source/gameengine/Expressions/IfExpr.h
source/gameengine/Expressions/InputParser.h
source/gameengine/Expressions/IntValue.h
source/gameengine/Expressions/KX_HashedPtr.h
source/gameengine/Expressions/Operator1Expr.h
source/gameengine/Expressions/Operator2Expr.h
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/StringValue.h
source/gameengine/Expressions/Value.h
source/gameengine/Expressions/VectorValue.h
source/gameengine/Expressions/VoidValue.h
source/gameengine/GameLogic/SCA_ActuatorEventManager.h
source/gameengine/GameLogic/SCA_AlwaysEventManager.h
source/gameengine/GameLogic/SCA_EventManager.h
source/gameengine/GameLogic/SCA_ExpressionController.h
source/gameengine/GameLogic/SCA_IActuator.h
source/gameengine/GameLogic/SCA_IInputDevice.h
source/gameengine/GameLogic/SCA_IScene.h
source/gameengine/GameLogic/SCA_JoystickManager.h
source/gameengine/GameLogic/SCA_KeyboardManager.h
source/gameengine/GameLogic/SCA_LogicManager.h
source/gameengine/GameLogic/SCA_MouseManager.h
source/gameengine/GameLogic/SCA_PropertyEventManager.h
source/gameengine/GameLogic/SCA_RandomEventManager.h
source/gameengine/GameLogic/SCA_RandomNumberGenerator.h
source/gameengine/GameLogic/SCA_TimeEventManager.h
source/gameengine/Ketsji/BL_BlenderShader.h
source/gameengine/Ketsji/BL_Material.h
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/BL_Texture.h
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_BulletPhysicsController.h
source/gameengine/Ketsji/KX_CameraIpoSGController.h
source/gameengine/Ketsji/KX_ClientObjectInfo.h
source/gameengine/Ketsji/KX_Dome.h
source/gameengine/Ketsji/KX_EmptyObject.h
source/gameengine/Ketsji/KX_IInterpolator.h
source/gameengine/Ketsji/KX_IPO_SGController.h
source/gameengine/Ketsji/KX_IPhysicsController.h
source/gameengine/Ketsji/KX_IScalarInterpolator.h
source/gameengine/Ketsji/KX_ISceneConverter.h
source/gameengine/Ketsji/KX_ISystem.h
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_LightIpoSGController.h
source/gameengine/Ketsji/KX_MaterialIpoController.h
source/gameengine/Ketsji/KX_MotionState.h
source/gameengine/Ketsji/KX_ObColorIpoSGController.h
source/gameengine/Ketsji/KX_OrientationInterpolator.h
source/gameengine/Ketsji/KX_PolygonMaterial.h
source/gameengine/Ketsji/KX_PositionInterpolator.h
source/gameengine/Ketsji/KX_RayCast.h
source/gameengine/Ketsji/KX_RayEventManager.h
source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h
source/gameengine/Ketsji/KX_SG_NodeRelationships.h
source/gameengine/Ketsji/KX_ScalarInterpolator.h
source/gameengine/Ketsji/KX_ScalingInterpolator.h
source/gameengine/Ketsji/KX_TimeCategoryLogger.h
source/gameengine/Ketsji/KX_TimeLogger.h
source/gameengine/Ketsji/KX_TouchEventManager.h
source/gameengine/Ketsji/KX_WorldInfo.h
source/gameengine/Ketsji/KX_WorldIpoController.h
source/gameengine/Network/NG_NetworkDeviceInterface.h
source/gameengine/Network/NG_NetworkMessage.h
source/gameengine/Network/NG_NetworkObject.h
source/gameengine/Network/NG_NetworkScene.h
source/gameengine/Physics/Bullet/CcdGraphicController.h
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
source/gameengine/Physics/common/PHY_IController.h
source/gameengine/Physics/common/PHY_IGraphicController.h
source/gameengine/Physics/common/PHY_IMotionState.h
source/gameengine/Physics/common/PHY_IPhysicsController.h
source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
source/gameengine/Physics/common/PHY_IVehicle.h
source/gameengine/Rasterizer/RAS_2DFilterManager.h
source/gameengine/Rasterizer/RAS_BucketManager.h
source/gameengine/Rasterizer/RAS_Deformer.h
source/gameengine/Rasterizer/RAS_FramingManager.h
source/gameengine/Rasterizer/RAS_ICanvas.h
source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
source/gameengine/Rasterizer/RAS_IRasterizer.h
source/gameengine/Rasterizer/RAS_IRenderTools.h
source/gameengine/Rasterizer/RAS_MaterialBucket.h
source/gameengine/Rasterizer/RAS_MeshObject.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
source/gameengine/Rasterizer/RAS_Polygon.h
source/gameengine/Rasterizer/RAS_Rect.h
source/gameengine/Rasterizer/RAS_TexVert.h
source/gameengine/SceneGraph/SG_BBox.h
source/gameengine/SceneGraph/SG_Controller.h
source/gameengine/SceneGraph/SG_DList.h
source/gameengine/SceneGraph/SG_IObject.h
source/gameengine/SceneGraph/SG_Node.h
source/gameengine/SceneGraph/SG_ParentRelation.h
source/gameengine/SceneGraph/SG_QList.h
source/gameengine/SceneGraph/SG_Spatial.h
source/gameengine/SceneGraph/SG_Tree.h

index fd41fb90f2fc76dd81e151e200ee3df876e10e24..d49c877f6101f5c54ebcb3ae928ca08284580005 100644 (file)
 
 #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
index 32391e6326438b3ed15f6e9adb7c998041451b8b..d4dd9af3d4fac4fb967d5ecb6bfbfa9090fb71d3 100644 (file)
@@ -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
 
index 5bf37acf23633f887dae69caf7d06bf05df88713..c801322e787f3c0f568d20a5618647a4eadf1862 100644 (file)
 
 #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
index 2f9e956a1d80c911a57757c72d6b79e9e356c6b9..92383e4b533758e6069c676bb8d96f8ad3a9d444 100644 (file)
 
 #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
index 60130e6bfc9ca8a4138467c790d10935a4b5cca3..70672b8350bf72bfc01e77f1da96f1e2c31aa41a 100644 (file)
 
 #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
index d99bb9b14a82df6301be9b92e3f18c1bdefa91fa..b6b2841e81c0611fd9ac3a79f0de1434c950b07a 100644 (file)
  */
 #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
index 684d89d492b3eaa10081012e59a8c56e543132c2..af0b7dc201ccbc316d2059a9c7cd00af188e958a 100644 (file)
@@ -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
index b20b8e81b37efd250cc5b03d2269f12464d6d36d..ed329e7953de402819a11bcb85740ffdc98ed130 100644 (file)
@@ -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
index 289826e45e70796afa7377b3bdea162e6214eb2b..1749d438d21e44c6720905074bf15d69f46a1057 100644 (file)
@@ -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
index b09cc2087ca771c5e60fd45d505fede087a3fa5d..5cc84c7d1e4c5c69103755c608ecb60d458efd9f 100644 (file)
@@ -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
index 949e5e1e3ad56afec78851c3b18609ed1c5a91d5..ca3770d40063fad61480a06c31c6088e0e9fe02d 100644 (file)
@@ -83,6 +83,12 @@ protected:
        vector<IpoCurve*>                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
index 7c43246a9d7bdf0d21b20a20384fb33cc7055378..b83895d5609ad5ea510f7fb9f8d487a28c40ba3a 100644 (file)
@@ -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
index e2d0e37664da169fd907ddc7acc163815384c46d..838c6c3cb9506aa3b22fc5597425352fe9583835 100644 (file)
@@ -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
index fd6bb0212b75033445027eb76047d49497ab8116..7ccb96e468341ba1cb94344d95fd7db263c9d990 100644 (file)
@@ -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
index 396a7d197dfe1b7448b85377b2f788be506559d2..eb15cee8ff97942c210e222cc6acbc061a0bd519 100644 (file)
@@ -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
index 7b5351344aebbb692c1ecc088e5f8eb6c1ddd2fc..bb87a21a683f1381eaf0427b47148c40b42efb11 100644 (file)
@@ -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
index 726619e7193bb01edfcea97a84c7b678cf7377b2..4d0103ec1ddc469f3451092f2e2815ed5927d2e9 100644 (file)
@@ -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
index b117140fe70e1432996173757493b91bd3067260..f48b8d34355d7f97e50e7c220e403fe60847b5cb 100644 (file)
@@ -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_)
index fb6b4a477a6840175d38528042221c48e4e6c632..01029d1655dafb4f3203fe0d913e4f63905b658f 100644 (file)
@@ -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
index b4b758feea740f3ce03a9d4a4362767f4c387339..2f65850c4f106181319086ac51691d0d3d541ac8 100644 (file)
@@ -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
index 400a2b7c7890986c276ba3e39b59f76ea3ee30f3..bd346fd0552044174dafa531bc695effc2c9e8bc 100644 (file)
@@ -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
index fb75b7c702baacfaf113c9e61b283cf53d7265fb..442f0eb6cf803db1c0310f95b994a3bb7a0d09ae 100644 (file)
@@ -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
index b307228c8b9b54dae0ba1eea2b70428b98dfc6a0..7c14329f755bcb3c58589123f1687f3dee854d80 100644 (file)
@@ -46,6 +46,13 @@ public:
        virtual CExpression*    CheckLink(std::vector<CBrokenLinkInfo*>& 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
index 9ab13dca413483c2b1de7490f08f749db141d7da..f06718c851ffb6ae9aaff2eac66ec5e4515b1f96 100644 (file)
@@ -44,6 +44,13 @@ public:
        virtual CExpression*    CheckLink(std::vector<CBrokenLinkInfo*>& 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_)
index 810bdc244a81edd1e75ed646051b82d3f1952e41..0d7eab27aebd58a7826aca4c0dc7e7efc9dd5e23 100644 (file)
@@ -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
index 06bf175574973aec9d1f0e37229bd1bd2ecc7efc..0513026c4cf661fbad4155d182b2d8f24a32903b 100644 (file)
@@ -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
index b11efb99d68d221d451cee8833cff6c26de01b8c..0b54436147b371e80a3ec63bf99258d2515c87e6 100644 (file)
 #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
index 4a1deb0eca3f1b1d5680ce383599b22814ce72fc..c2bc68076a023f42974ce0227500e06eae91804c 100644 (file)
@@ -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_)
index 4064890bbae8b7a5d67a64fc779dc3cb2f27812d..bb26b7c03bece9b99e7562270aa9a698484f7f48 100644 (file)
@@ -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
index d68aa9f041007c5c17faa7901b240a81d6e6c7fa..e9e81dddaaaeee9d5dfedcc28c5649beb5081692 100644 (file)
@@ -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
index c580e8fd23a29f9f4ebf1cbc3c4f000806c4df05..069eb8d9c24670b953cfc5341cea9e5321e46aeb 100644 (file)
@@ -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
index 8c9f99b335ec4f92de75c8953f0f8326e68acebd..5f08736afde1706e53f8e3c0333fd4b3a83b02b6 100644 (file)
 #include <map>         // 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
index 19c7dd30076243d4e48235a7e9672ea4da120388..49fb1e7ea08c0783dedd670e33fd54af6744431d 100644 (file)
@@ -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
index 10a6ff9ad3dcbb9d5f4eb1a64ceea13b26a5a4aa..50ec4ff1ee732797af93d153821e43abd8a21674 100644 (file)
@@ -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
index a7d61627c23390eb6e913f4bd04ce53c0c6cd2b3..f3884c87a752e4ebcb899d8e747e34a7fcf0ade4 100644 (file)
@@ -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
index a619eecddd4cb377886d04ce5dbec9e83b9a8a73..9540e3b71f680955231ffdf839958894208caff0 100644 (file)
@@ -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
index 5ff55849bfe46cee2a5265f1748a45301d2e744d..424150ffa6366251a4029e78fd9868b0eb0e71d8 100644 (file)
@@ -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
index 705f6dfc415e4b0a4309a4be38f94e2f1ccce11f..4c1dfcb95a2103ba8b0cef12fb9326e4ea77a574 100644 (file)
@@ -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
index 13c718ee83711e7f8660f17635e70ddc9c0034ab..00ba8c9ce4e23e3827e87d8a1204b720399c0df6 100644 (file)
@@ -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
index a0d77ed3c03815881e7cd59d56108454e582ba55..228d7684b0fb1dd0ca1bb17c25092b1544dedb3b 100644 (file)
 #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
index 79d922a998e64f566294d5e9d45a7cc3c11cbaed..ced9ca94cecf38150cb492887c717316a4f07afe 100644 (file)
 
 #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
index d3a7ac95bea62da4340d944ae5c544a15cf012fc..be55e95b0334ab7decb13415935d08804ad60786 100644 (file)
@@ -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
index 8f3cc0ab715c0a085d4af3883f69dd3d4d56934b..c5553a74aef09799f995c17099f129c80ef13143 100644 (file)
@@ -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
index 53e75e1eaeee284d1c7293caa3fbf9ed9ef0a432..402090357cbdff0f89846513daf37fd40d013de0 100644 (file)
@@ -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
index efa4c639ce7017907c66be30a1dd8a7353be553f..ef1533c636bd2be7f2dfd3668f06d8d13bba101a 100644 (file)
@@ -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
index f166065b198b62f7ef3c21ae47f9e96f1f1d688a..011f3285f637f780356025cb80a9fd60ca814a43 100644 (file)
@@ -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();
index 79138c23c628089053efd577bf9b61d2ccda1bbf..c8b511b87b7482da7270336ab7d7478ae8f3ab2e 100644 (file)
@@ -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
index 842a0331752143f6283f3f7ab329626f95402d10..f986fadeaf0a16df5975df18db7842e10ee54591 100644 (file)
 #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 */
index bd57e12eb4474dd0a7eafcc31a4e8d1483b9d166..089f21e603b889e28d7c2af5bb1e75be1efc0e1c 100644 (file)
@@ -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
index 9af53bfc86323f3996ca8898ac00b6aa1608ea97..073ce8f1ca5f9fea2e77b56f48e9574d5ee62cf7 100644 (file)
@@ -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__
index 4f572f9589186dfc11303cc2f7f1a9ce123f8838..6b53e7fa8b1c84a3557177c77e07b8ad36ea3345 100644 (file)
@@ -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
index 42969996b3ec0b8e77ef5e9f154f0b338909b177..b2610d7762afb2109687bdfdfad2c38d1767a314 100644 (file)
@@ -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
 };
 
 /**
index 830ffceb0f78c151d478d0b89f6d5bceeba4c911..2dfd9c542d33d7e22d799cde5c99c3a80bc1d932 100644 (file)
@@ -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__
index 605ca207949b8a1f8efc615869dde7f7db47b02a..cdbdc4bd4293d268a0aa26fff09aa94e3abcad52 100644 (file)
 #include "MT_Vector3.h"
 #include "MT_Vector4.h"
 
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
 struct MTFace;
 class KX_Scene;
 
index 755b1cbd780062bc7bb3aef79d3ff12daeba8687..7fc799abb7e5a3a13c8e7f93fbde3d43e396a869 100644 (file)
@@ -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
index 33245e79c23d7b32741cc5f5118f5adeb5fa2d04..85d93962a14c41002068627f3b1844c94c7edd4f 100644 (file)
@@ -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
index 1898dc71ef86ac1434ccded772cd2358eea500e8..74647dd47fdae460a1828f941d53cfbb38413960 100644 (file)
@@ -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
index 20b60ef0173317d28d62c76d28ab5f0fe3df6dd8..9ff33fe285222650adc53503a6b89bbb4ac05320 100644 (file)
@@ -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
index 62aa7fcd017e3c98ae49eb28f44e1667b0215506..fa405e20076561a8b45865101ca916c16d14caa5 100644 (file)
@@ -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
index 8c899a4db0b6e3f565b004d50c35b49548000bb0..52b9b3be5afa708aec4444c20ddafd5753e606fb 100644 (file)
 
 #include <vector>
 
+#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<KX_IInterpolator *> T_InterpolatorList;
index 031b74294cedfa8c526ac2bb6aa635474c989d7b..68a74c3a364b07637c42f17404b69f47cf6ae04f 100644 (file)
@@ -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
index 81c010450713ac2d338638140084900f9806d2c5..f9dcf81bca5c2064cd2797216cd15f96373a9e04 100644 (file)
@@ -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
index 6ba685885e91e09ac1a94d1a30dd0a98a9a8efce..ec6183b88a1b81290e4671227617a5e9a929e8d5 100644 (file)
 #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
index 45b3276e98ca547fc79c262a706ae9c96e58ef56..f098b0bebf5d7c2f40ef239cb15f14141367202d 100644 (file)
 #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
index 204e116e822821ef0cf78aaa24bb016ebabe2438..deee91f62e875c5cbadb5db385ded37fc726bf32 100644 (file)
@@ -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
index a36b3f163fda16c972a8ae16630c554ae2570062..acb9e53df8ab0d7d85c6b549526f7e3502e174c9 100644 (file)
@@ -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
index 98870cf5b3f2237729aa5d915d97e9e5ff0652d4..811dba5dba87c66cd81d42fa9bf2f1fe3f9b47c4 100644 (file)
@@ -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
index 4d2e258bf94cdd0399ebb9da4f782604f23cfb2e..906c12426eb559dd303602aba4b032192961ae7f 100644 (file)
@@ -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
 };
 
 
index 0e43e88fbebde823687981caa87d8be0cff8a72d..63c265aa8a7ea6113e9e3184fe090ca44b782cf5 100644 (file)
 
 #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
index 6d63dd77683e31c2fe31b00403f90e615b506857..a32d027be9c708bce8c0d5355d89d2ab5505bc73 100644 (file)
@@ -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
index 2bd9f69d82421959f1e4476270d5eb07e0517ab4..d8ecc74277c1398e6f87400fae4bc44a61488185 100644 (file)
@@ -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
index 266b4d7e789d1c85f688a1535edceb3719f9182a..dc42bd2f81bdbb37e8f6d7b93c138170972f72df 100644 (file)
 #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,
index bff0b4201c2483ddce1097809058cdd83910bd8c..f6c6fa98a0e0af7461327f9e3c1be3963ed9f0fc 100644 (file)
@@ -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
index c3084c997a193456a91039a4144c66526e1f9862..cdafc894f6c380e1529fba29cdd3e3ef5da170cb 100644 (file)
@@ -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 T> 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
 };
        
 
index b816d4d5250fd272396607d6ac4d63f52e31d34f..27c9be14d1f7a2986d05204ad04bf757b9170980 100644 (file)
@@ -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
index c9baf2288557a0d057d6e162f6123208ca59e0b3..dd4419543a2f98eb3b92f75cef0408ae357d9a02 100644 (file)
@@ -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
index d8fb9211f214ff4d74c97d7deeffafe6f757a92b..c1640f3e0a0f0d864c4d4c679b811e0bd42432d8 100644 (file)
@@ -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
index 8835c98c1840e944d5368c658fbc19ab6c5cd524..ca011ab5db07b0fd5719587f24d27dfe3a699f06 100644 (file)
@@ -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
index a7b5d7e559a16648bf553a1f2a72933b22bfd463..460563d41356dd1c2720e4dc19ecc7285611a934 100644 (file)
@@ -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
index 0cc34b53736c2997720e3b427db4068fafafc1bd..fe15967f93c724a37807be8902b7b9b41965a309 100644 (file)
@@ -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
index 0962f02a877edb914d83ad5b0b921d37de6a6082..2e73abc75b525db917807e8a82bc4523b8e4cc44 100644 (file)
 
 #include <deque>
 
+#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
index cc77bccfc311a6db5212289d29cc3e78840ac1b9..6da37d615a419fee12cab92a32d2dce867ff8c9f 100644 (file)
@@ -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
index fe4e0c51b24b43d65aecc66aa1ce1fe71c90171d..2c2346ca38e4398fc20c2ea68ccd0b12a8a503a1 100644 (file)
 
 #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
index d90c03d09eefc7ed51c680d1944c4d577549a201..8622d80a35f8879ff4cbc0cdd219fdcd68546e43 100644 (file)
@@ -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
index 4a47774a762306d099cf46d8afbcf31ee77758b4..2a2a909a04dcbed6d1f471bd643c38c79f032984 100644 (file)
@@ -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
index 687c8120ecaeba2c320b6b6d1b14b49c4d13b090..a2f76dc1fae34d69481d2abaf43a53c85ddc73d7 100644 (file)
 
 #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
index c01d76a47fc11627a63dcf1ba6fb35605d19487e..4bf636bf01142cad6dc15b32c3b3e864b1f85aca 100644 (file)
 
 #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
index fc6367c352631d7ac0a00aae66822077e4e5656c..d5d6e8e05343ac56ea2c62b5d641f5d0a2debe90 100644 (file)
 #include "STR_HashedString.h"
 #include <vector>
 
+#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
index b0626f902c2c56815008928dfb3d98c532cc87c1..99885eb99eee5d1a516d330245f2c510b7a1a1f5 100644 (file)
@@ -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
index 8eb2e616ecf232232671c827c87dbf03e3c320ce..69b16ca35bd9ea4ffe38311a777fc125a97159c0 100644 (file)
@@ -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
 };
 
 
index bc5491e00ccd06260392fb413e81e4727a54ac2c..e087eac32c5a02be06c9d9dc3b5aa7b707b6671e 100644 (file)
@@ -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
index 8dbd137f9de3c184f329dfce47c3af44c69582fc..28440ebdad4e3761d27baaae41ce8aa0b6ad0610 100644 (file)
@@ -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
index 45e93f9d24e2cac9952fc190df2b838ffa07bd30..a053a9679b8585af4eb1407947695ebc5f8e759a 100644 (file)
@@ -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 
 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
index 470d42cb84a31f94d88e30924a36c7771b8e3bb1..aae971ff42a243fbc1071e04b9e76729b37c4a64 100644 (file)
@@ -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
index f7bcbd4f2d03aa5f38838e89015b8780cde79ec5..c3d01c010ff02258fe993c7954116a1545c29927 100644 (file)
 #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
index d7b8cb0b54f6063ad600dcb884709b0328b6a533..664e5fddd83c9254f919c9faff265c457b77f26f 100644 (file)
@@ -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
index c76e9d175ce91d6f27f3eaec7a144d7b69865fce..291dac298dc733ef9729dd428c139a525c48fe75 100644 (file)
 
 #include <vector>
 #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
index 498df0dd840192d24b294f19d3a02e60576aa752..261bae480f5427e4a15bb793c0e6da02cac40230 100644 (file)
@@ -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
index 6a420a974d444a904c43aed7a406556acde23c86..99d4ea595abce572ae23cd1335df2193826c51d3 100644 (file)
 
 #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<STR_String>& 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
index 2b81ddd3c826b7965e020ccc6d7585479c0985db..dcac41ab6e9bb62c4e94d83943fd91bd0e06b734 100644 (file)
@@ -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
index 75c0dcd1eeb55b864e5cdc00f9803233fb1e4865..6f4cd425c6c0f7a5c3d265217e258b60e799b0bf 100644 (file)
 #include <stdlib.h>
 #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
index 4398e2d00c34973f5656c248a3c7c8d95466531e..3ae794c430a9bf2696dccb0bc7efdc62d2aec1ad 100644 (file)
 #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
index f3f817a943dbddda23ea18899547638674503f47..dae4fb3f4d29286c46a72e87ce7a16851851d395 100644 (file)
  * 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
index a01196ef30723309fea2b153fc47a742507525d8..af909dfa731779e31333305268eab102222170a0 100644 (file)
 #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)
index dc8c3c1ebf8186a4959ae6d3277157157c07ad6a..054064139411cedca3f8c43d32919d225d088aee 100644 (file)
 #include <vector>
 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
index 52f6397cf6cf37f07c7e0fda36e15a5eba0f8f73..5d52ddc968832c9f9dc2f9b96c83020f52a402a5 100644 (file)
 #include <vector>
 #include <algorithm>
 
+#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
index 8db75b8b735d8d552fd357c5e30f018eef0d8664..207763392b2ad54eecc6b4c32cce2445d8399cee 100644 (file)
@@ -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<GEN_HashedPtr,RAS_MeshSlot*> 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
index f34546a8ff7d744766ba88a12d4425f5ebf9dbb8..1738423c4f30953def999c3be2284ed6a016cb1a 100644 (file)
@@ -173,6 +173,13 @@ public:
        };
 
        vector<vector<SharedVertex> >   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
index fe358808e4a39af7a48602452286d7be3ef048b2..cff48081f02d6692fcc02b7b4b7b1fb2d7946f20 100644 (file)
@@ -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
index e3422394e9ee959aa0b1352a1d4d187371e1036d..db0f97bf46f886f0e759b887b8aa5bcbbae6eda8 100644 (file)
@@ -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
index 766bbfbed0efe55c5e036e3b8d461c4118e52dc5..6112c1a4d98cf19bf2e1230c0bf661c4c3fbaa75 100644 (file)
@@ -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
index 41eaa6bdd4a1a1da0487cbef0024eff9eb124b3b..a5b777380261acd71447f016349bb0bec77c8d2e 100644 (file)
 #include <vector>
 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
index 4cd0c636cfd57caa1a277929dcfc13c1d2d82ff4..ca7435673c9f88e69bd5846f16f7a87e748bffc4 100644 (file)
 #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
index 811867f35790248a09d4158541c62720d78c33d0..b93078f47120d9c5a5b83cf718c932c592c9ae66 100644 (file)
 #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
index c39ad268e25bcd45fc9b37f5261ddc98553149fb..8dbb9869daef966c2ce355c87e521ce6628b93a8 100644 (file)
 
 #include <vector> 
 
+#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__ */
index c32885b915f2d82c3b4d200afe9cd104108cd22f..db9d7bdb464b08ffc01303afb00cb728e1626457 100644 (file)
 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) {
index 7bef13cc9e3dc8564e5737919c797b81a105786a..3e17fb55dc00d1d2bb3113fdc8f4d8f60fa59731 100644 (file)
 
 #include <stdlib.h>
 
+#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
index 8f448a0e890644579cdd95f95b1900b405c72b26..23e6c1e9c99d232d256149ef1c2bac8920a928f4 100644 (file)
@@ -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
index 7c6ef92f670647d3c9fb7d68099cb383f713da14..4281bcd11f678f38a2aeab85feea50f09098a8b1 100644 (file)
@@ -40,7 +40,6 @@ typedef std::vector<SG_Node*> 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
index 8f45df09b27b72fb40520e8a110d228f89b8a236..a6a43c191158b622247efbfcd2708db472e77a7e 100644 (file)
@@ -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
index d8afc33ea4f02a0a0df32f980f5ce54d0573773e..6399111d80b260940574cc549fab94156473ce14 100644 (file)
@@ -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
index 6e274487c9d3809c223b8e1fcc920a40f5b5aa74..a818c8c81f779f9ee5b3fec4f1c69fd9d10069b2 100644 (file)
@@ -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
index 4741af83aae168bea7a2a66fdcea67f29d8a1704..6ca3307920e8918d221b12267a58ba417eba5599 100644 (file)
@@ -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__ */