There is no possibility for mpctx->items to be NULL at the point where
the code was removed, since we enforce that fillcount > 0, if
mpctx->items == NULL when isc_mempool_get is called, then we will
allocate fillcount more items and add to the mpctx->items list.
}
}
- /*
- * If we didn't get any items, return NULL.
- */
item = mpctx->items;
- if (ISC_UNLIKELY(item == NULL)) {
- atomic_fetch_sub_release(&mpctx->allocated, 1);
- goto out;
- }
-
mpctx->items = item->next;
INSIST(atomic_fetch_sub_release(&mpctx->freecount, 1) > 0);
ADD_TRACE(mpctx->mctx, item, mpctx->size, file, line);
-out:
MPCTXUNLOCK(mpctx);
return (item);