X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=blobdiff_plain;f=ABM2%2FEngine%2Fmmanager.h;fp=ABM2%2FEngine%2Fmmanager.h;h=b8ce0779f09f070b1e02f6776af06fa5fe073d43;hp=28ce787b132700013d7c2102c343613543c97a6f;hb=b5abb5111b87fc7973c1e3f3f989e4adc92362d6;hpb=e8052fbdfce6586a04ac299b3970c89a5f63db7b diff --git a/ABM2/Engine/mmanager.h b/ABM2/Engine/mmanager.h index 28ce787..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