}
isc_mem_create(&mctx);
- isc_mem_setname(mctx, "dig", NULL);
+ isc_mem_setname(mctx, "dig");
isc_log_create(mctx, &lctx, &logconfig);
isc_log_setcontext(lctx);
}
isc_mem_create(&named_g_mctx);
- isc_mem_setname(named_g_mctx, "main", NULL);
+ isc_mem_setname(named_g_mctx, "main");
setup();
* memory.
*/
isc_mem_create(&cmctx);
- isc_mem_setname(cmctx, "cache", NULL);
+ isc_mem_setname(cmctx, "cache");
isc_mem_create(&hmctx);
- isc_mem_setname(hmctx, "cache_heap", NULL);
+ isc_mem_setname(hmctx, "cache_heap");
CHECK(dns_cache_create(cmctx, hmctx, named_g_taskmgr,
named_g_timermgr, view->rdclass,
cachename, "rbt", 0, NULL,
* enabling threads because it will be require more memory.
*/
isc_mem_create(&res->buckets[i].mctx);
- isc_mem_setname(res->buckets[i].mctx, name, NULL);
+ isc_mem_setname(res->buckets[i].mctx, name);
isc_task_setname(res->buckets[i].task, name, res);
ISC_LIST_INIT(res->buckets[i].fctxs);
atomic_init(&res->buckets[i].exiting, false);
isc_mem_create(&mctx);
result = dns_adb_create(mctx, view, timermgr, taskmgr, &view->adb);
- isc_mem_setname(mctx, "ADB", NULL);
+ isc_mem_setname(mctx, "ADB");
isc_mem_detach(&mctx);
if (result != ISC_R_SUCCESS) {
dns_resolver_shutdown(view->resolver);
REQUIRE(target != NULL && *target == NULL);
isc_mem_create(&mctx);
- isc_mem_setname(mctx, "zonemgr-pool", NULL);
+ isc_mem_setname(mctx, "zonemgr-pool");
*target = mctx;
return (ISC_R_SUCCESS);
*/
void
-isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag);
+isc_mem_setname(isc_mem_t *ctx, const char *name);
/*%<
* Name 'ctx'.
*
*
*\li Only the first 15 characters of 'name' will be copied.
*
- *\li 'tag' is for debugging purposes only.
- *
* Requires:
*
*\li 'ctx' is a valid ctx.
* empty.
*/
-void *
-isc_mem_gettag(isc_mem_t *ctx);
-/*%<
- * Get the tag value for 'task', as previously set using isc_mem_setname().
- *
- * Requires:
- *\li 'ctx' is a valid ctx.
- *
- * Notes:
- *\li This function is for debugging purposes only.
- *
- * Requires:
- *\li 'ctx' is a valid task.
- */
-
#ifdef HAVE_LIBXML2
int
isc_mem_renderxml(void *writer0);
struct stats *stats;
isc_refcount_t references;
char name[16];
- void *tag;
size_t total;
size_t inuse;
size_t maxinuse;
ctx->flags = flags;
isc_refcount_init(&ctx->references, 1);
memset(ctx->name, 0, sizeof(ctx->name));
- ctx->tag = NULL;
ctx->total = 0;
ctx->inuse = 0;
ctx->maxinuse = 0;
}
void
-isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag) {
+isc_mem_setname(isc_mem_t *ctx, const char *name) {
REQUIRE(VALID_CONTEXT(ctx));
LOCK(&ctx->lock);
strlcpy(ctx->name, name, sizeof(ctx->name));
- ctx->tag = tag;
UNLOCK(&ctx->lock);
}
return (ctx->name);
}
-void *
-isc_mem_gettag(isc_mem_t *ctx) {
- REQUIRE(VALID_CONTEXT(ctx));
-
- return (ctx->tag);
-}
-
/*
* Memory pool stuff
*/
#include <isc/buffer.h>
#include <isc/hash.h>
+#include <isc/hp.h>
#include <isc/mem.h>
#include <isc/os.h>
#include <isc/socket.h>
workers = atoi(p);
}
+ isc_hp_init(ISC_MAX(ISC_MIN(workers, 256), 128));
+
netmgr = isc_nm_start(test_mctx, workers);
CHECK(isc_taskmgr_create(test_mctx, workers, 0, netmgr, &taskmgr));
CHECK(isc_task_create(taskmgr, 0, &maintask));
isc_mem_destroy
isc_mem_detach
isc_mem_getname
-isc_mem_gettag
isc_mem_inuse
isc_mem_isovermem
isc_mem_maxinuse
for (i = 0; i < npools; i++) {
manager->mctxpool[i] = NULL;
isc_mem_create(&manager->mctxpool[i]);
- isc_mem_setname(manager->mctxpool[i], "client", NULL);
+ isc_mem_setname(manager->mctxpool[i], "client");
}
manager->magic = MANAGER_MAGIC;