BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for better tracking memory usage.

* off by default.
* new/delete are at the bottom of each class
* python BGE objects have the new/delete in the Py_Header macro.
This commit is contained in:
Campbell Barton
2009-08-18 15:37:31 +00:00
parent 3682624616
commit 14d33b3c1f
123 changed files with 1068 additions and 36 deletions

View 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

View 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

View 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