X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=blobdiff_plain;f=ABM2%2FEngine%2Fmmanager.h;h=b8ce0779f09f070b1e02f6776af06fa5fe073d43;hp=0a8211be4e68b006b6b0b58fd2a73aa145135c5b;hb=b5abb5111b87fc7973c1e3f3f989e4adc92362d6;hpb=0835c5605c80efd286ccb7eff92fffc07689f359 diff --git a/ABM2/Engine/mmanager.h b/ABM2/Engine/mmanager.h index 0a8211b..b8ce077 100755 --- a/ABM2/Engine/mmanager.h +++ b/ABM2/Engine/mmanager.h @@ -1,7 +1,8 @@ #ifndef MMANAGER_H_INCLUDED #define MMANAGER_H_INCLUDED -#include "engine.h" +#include +#include class IMMObject { @@ -13,6 +14,8 @@ class IMMObject long refCount; bool bIsStackAllocated; static std::list heapObjects; + static unsigned long heapUsage; + unsigned long heapAllocSize; protected: IMMObject(); virtual ~IMMObject(); @@ -40,17 +43,19 @@ public: ~CMMPointer(){if(obj)obj->Release();} - inline void operator =(const CMMPointer &p) + inline CMMPointer &operator =(const CMMPointer &p) { if(obj)obj->Release(); obj=p.obj; if(obj)obj->AddRef(); + return *this; } - inline void operator =(T* o) + inline CMMPointer &operator =(T* o) { if(obj)obj->Release(); obj=o; if(obj)obj->AddRef(); + return *this; } inline T& operator *() const @@ -111,4 +116,4 @@ class CMMDynamicBlob : public IMMObject unsigned long blobsize(){return dataSize;} }; -#endif \ No newline at end of file +#endif