diff --git a/bin/named/main.c b/bin/named/main.c index 4af0a51768..50a44343e7 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: main.c,v 1.161 2008/01/18 23:46:57 tbox Exp $ */ +/* $Id: main.c,v 1.162 2008/04/03 23:14:52 jinmei Exp $ */ /*! \file */ @@ -878,6 +878,7 @@ main(int argc, char *argv[]) { if (result != ISC_R_SUCCESS) ns_main_earlyfatal("isc_mem_create() failed: %s", isc_result_totext(result)); + isc_mem_setname(ns_g_mctx, "main", NULL); setup(); diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 5d6bc1a073..9011eb8436 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.365 2008/04/03 05:55:52 marka Exp $ */ +/* $Id: resolver.c,v 1.366 2008/04/03 23:14:52 jinmei Exp $ */ /*! \file */ @@ -6505,6 +6505,7 @@ dns_resolver_create(dns_view_t *view, goto cleanup_buckets; } res->buckets[i].mctx = NULL; + snprintf(name, sizeof(name), "res%u", i); #ifdef ISC_PLATFORM_USETHREADS /* * Use a separate memory context for each bucket to reduce @@ -6517,12 +6518,11 @@ dns_resolver_create(dns_view_t *view, DESTROYLOCK(&res->buckets[i].lock); goto cleanup_buckets; } + isc_mem_setname(res->buckets[i].mctx, name, NULL); #else isc_mem_attach(view->mctx, &res->buckets[i].mctx); #endif - snprintf(name, sizeof(name), "res%u", i); isc_task_setname(res->buckets[i].task, name, res); - isc_mem_setname(res->buckets[i].mctx, name, NULL); ISC_LIST_INIT(res->buckets[i].fctxs); res->buckets[i].exiting = ISC_FALSE; buckets_created++;