12 #ifndef __ICEMEMORYMACROS_H__
13 #define __ICEMEMORYMACROS_H__
67 while(nb--) *dest++ = value;
90 #define SIZEOFOBJECT sizeof(*this)
91 //#define CLEAROBJECT { memset(this, 0, SIZEOFOBJECT); }
92 #define DELETESINGLE(x) { delete x; x = null; }
93 #define DELETEARRAY(x) { delete []x; x = null; }
94 #define SAFE_RELEASE(x) if (x) { (x)->Release(); (x) = null; }
95 #define SAFE_DESTRUCT(x) if (x) { (x)->SelfDestruct(); (x) = null; }
98 #define CHECKALLOC(x) if(!x) return SetIceError("Out of memory.", EC_OUT_OF_MEMORY);
100 #define CHECKALLOC(x) if(!x) return false;
104 #define SAFE_ALLOC(ptr, type, count) DELETEARRAY(ptr); ptr = new type[count]; CHECKALLOC(ptr);
106 #endif // __ICEMEMORYMACROS_H__