+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
+ #define DEFINE_REF(c) \
+ void c::AddRef() \
+ { \
+ eSingleLocker l(ref_lock); \
+ ++object_total_remaining; \
+ ++ref; \
+ eDebug("OBJECT_DEBUG " #c "+%p now %d", this, (int)ref); \
+ } \
+ void c::Release() \
+ { \
+ { \
+ eSingleLocker l(ref_lock); \
+ --object_total_remaining; \
+ --ref; \
+ eDebug("OBJECT_DEBUG " #c "-%p now %d", this, (int)ref); \
+ } \
+ if (!ref) \
+ delete this; \
+ }
+ #elif defined(__mips__)
+ #define DECLARE_REF(x) \
+ public: void AddRef(); \
+ void Release(); \
+ private: oRefCount ref;