24 #ifndef __CHUNK_ALLOCATOR__
25 #define __CHUNK_ALLOCATOR__
44 virtual int numChunks() = 0;
60 unsigned size()
const {
return m_size; }
119 #define ODCA_HEAP_OPERATORS() \
120 void* operator new(size_t); \
121 void operator delete(void*)
123 #define ODCA_HEAP_ALLOCATOR() \
124 static AllocatorArrayML s_aAlloc
126 #define ODCA_HEAP_OPERATORS_DEFINE(baseClass, num) \
127 void* baseClass::operator new(size_t size) \
129 return s_aAlloc.getAt(num)->alloc((int)size); \
131 void baseClass::operator delete(void* p) \
133 s_aAlloc.getAt(num)->release(p); \
136 #define ODCA_HEAP_OPERATORS_DEFINE_0(baseClass) \
137 ODCA_HEAP_OPERATORS_DEFINE(baseClass, 0)
139 #define ODCA_HEAP_ALLOCATOR_DEFINE(baseClass, numAllocs, allocMask) \
140 AllocatorArrayML baseClass::s_aAlloc(numAllocs, allocMask)
142 #define ODCA_HEAP_ALLOCATOR_DEFINE_1(baseClass) \
143 ODCA_HEAP_ALLOCATOR_DEFINE(baseClass, 1, 0)
144 #define ODCA_HEAP_ALLOCATOR_DEFINE_1_ENH(baseClass) \
145 ODCA_HEAP_ALLOCATOR_DEFINE(baseClass, 1, 1)
147 #define ODCA_HEAP_ALLOCATOR_RESET(baseClass) \
148 baseClass::s_aAlloc.reset()
149 #define ODCA_HEAP_ALLOCATOR_UNINIT(baseClass) \
150 baseClass::s_aAlloc.uninit()
155 template<
class T,
class TInterface = T>
164 void*
operator new (
size_t size) {
return T::operator
new (
size); }
165 void operator delete (
void* p) { T::operator
delete (p); }
178 #define GIRXREIMPL_CONSTR(ClassName) OdGiRxObjectReImpl<ClassName>::createObject()
FIRSTDLL_EXPORT void releaseLocalHeaps(unsigned nThreadId, const unsigned *aThreadId)
FIRSTDLL_EXPORT void addLocalHeaps(unsigned nThreadId, const unsigned *aThreadId)
AllocatorArray(unsigned size, int mask)
IAllocator * getAt(unsigned i)
AllocatorArrayML(unsigned size, int mask)
virtual void release(void *p)=0
virtual void * alloc(int)=0
static OdSmartPtr< TInterface > createObject()