1 #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
2 # define JSONCPP_BATCHALLOCATOR_H_INCLUDED
7 # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
23 template<
typename AllocatedType
24 ,
const unsigned int objectPerAllocation>
28 typedef AllocatedType
Type;
35 assert(
sizeof(AllocatedType) * objectPerAllocation >=
sizeof(AllocatedType *) );
36 assert( objectsPerPage >= 16 );
94 AllocatedType
buffer_[objectPerAllocation];
103 const unsigned int mallocSize =
sizeof(
BatchInfo) -
sizeof(AllocatedType)* objectPerAllocation
104 +
sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;
107 batch->
used_ = batch->buffer_;
108 batch->end_ = batch->buffer_ + objectsPerPage;
122 # endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION
124 #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED
void operator=(const BatchAllocator &)
tuple batch
Use ROOT's batch mode, unless outputting to C macros, since there is a bug in pyROOT that fails to ex...
AllocatedType * allocate()
unsigned int objectsPerPage_
BatchAllocator(unsigned int objectsPerPage=255)
static BatchInfo * allocateBatch(unsigned int objectsPerPage)
AllocatedType buffer_[objectPerAllocation]
void release(AllocatedType *object)
BatchInfo * currentBatch_
AllocatedType * freeHead_
Head of a single linked list within the allocated space of freeed object.