}
res->buckets[i].mctx = NULL;
snprintf(name, sizeof(name), "res%u", i);
- /*
- * Use a separate memory context for each bucket to reduce
- * contention among multiple threads. Do this only when
- * enabling threads because it will be require more memory.
- */
- isc_mem_create(&res->buckets[i].mctx);
+ isc_mem_attach(view->mctx, &res->buckets[i].mctx);
isc_mem_setname(res->buckets[i].mctx, name);
isc_task_setname(res->buckets[i].task, name, res);
ISC_LIST_INIT(res->buckets[i].fctxs);