125T *QRecyclePoolPrivate<T, Step>::allocate()
127 PoolType *rv =
nullptr;
130 nextAllocated = rv->nextAllocated;
131 }
else if (currentPage && currentPage->free) {
132 rv = (PoolType *)(currentPage->array + (Step - currentPage->free) *
sizeof(PoolType));
135 Page *p = (Page *)malloc(
sizeof(Page));
136 p->nextPage = currentPage;
140 rv = (PoolType *)currentPage->array;
150void QRecyclePoolPrivate<T, Step>::dispose(T *t)
152 PoolType *pt =
static_cast<PoolType *>(t);
155 QRecyclePoolPrivate<T, Step> *This = pt->pool;
156 pt->nextAllocated = This->nextAllocated;
157 This->nextAllocated = pt;
158 --This->outstandingItems;
159 This->releaseIfPossible();