isc_mem_t *mctx;
element *item;
+
mpctx = *mpctxp;
*mpctxp = NULL;
mpctx->magic = 0;
+ fprintf(stderr, "%s(%p)\n", __func__, mpctx);
+
if (atomic_load_acquire(&mpctx->allocated) > 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mempool_destroy(): mempool %s "
unsigned int i;
REQUIRE(VALID_MEMPOOL(mpctx));
+ REQUIRE(isc_tid_v < mpctx->max_threads);
element *item;
REQUIRE(VALID_MEMPOOL(mpctx));
REQUIRE(mem != NULL);
+ REQUIRE(isc_tid_v < mpctx->max_threads);
isc_mem_t *mctx = mpctx->mctx;
element *item;
DELETE_TRACE(mctx, mem, mpctx->size, file, line);
- /*
- * If the number of freeitems is more than number of allocated items,
- * return the item to the allocator.
- */
- if (freecount >= allocated) {
- mem_putstats(mctx, mem, mpctx->size);
- mem_put(mctx, mem, mpctx->size);
- return;
- }
-
- /*
- * Otherwise, attach it to our free list and bump the counter.
- */
item = (element *)mem;
item->next = mpctx->items[isc_tid_v];
mpctx->items[isc_tid_v] = item;