126T *QRecyclePoolPrivate<T, Step>::allocate()
128 PoolType *rv =
nullptr;
131 nextAllocated = rv->nextAllocated;
132 }
else if (currentPage && currentPage->free) {
133 rv = (PoolType *)(currentPage->array + (Step - currentPage->free) *
sizeof(PoolType));
136 Page *p = (Page *)malloc(
sizeof(Page));
137 p->nextPage = currentPage;
141 rv = (PoolType *)currentPage->array;
151void QRecyclePoolPrivate<T, Step>::dispose(T *t)
153 PoolType *pt =
static_cast<PoolType *>(t);
156 QRecyclePoolPrivate<T, Step> *This = pt->pool;
157 pt->nextAllocated = This->nextAllocated;
158 This->nextAllocated = pt;
159 --This->outstandingItems;
160 This->releaseIfPossible();