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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user