From ecf229a39fc253da39ae6baeab9f5c1955786ff6 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 3 Dec 2010 15:55:47 -0800 Subject: [PATCH] Add the "thread.[de]allocatedp" mallctl's. --- jemalloc/doc/jemalloc.xml.in | 30 +++++++++++++++++++++++++++++- jemalloc/src/ctl.c | 8 +++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/jemalloc/doc/jemalloc.xml.in b/jemalloc/doc/jemalloc.xml.in index 6951160e..97893c16 100644 --- a/jemalloc/doc/jemalloc.xml.in +++ b/jemalloc/doc/jemalloc.xml.in @@ -1172,7 +1172,7 @@ malloc_conf = "xmalloc:true";]]> calling this interface. - + thread.allocated (uint64_t) @@ -1186,6 +1186,20 @@ malloc_conf = "xmalloc:true";]]> + + thread.allocatedp + (uint64_t *) + r- + [] + + Get a pointer to the the value that is returned by the + thread.allocated + mallctl. This is useful for avoiding the overhead of repeated + mallctl* calls. + + + thread.deallocated (uint64_t) @@ -1198,6 +1212,20 @@ malloc_conf = "xmalloc:true";]]> cases. + + + thread.deallocatedp + (uint64_t *) + r- + [] + + Get a pointer to the the value that is returned by the + thread.deallocated + mallctl. This is useful for avoiding the overhead of repeated + mallctl* calls. + + arenas.narenas diff --git a/jemalloc/src/ctl.c b/jemalloc/src/ctl.c index 0e100590..3c8adab9 100644 --- a/jemalloc/src/ctl.c +++ b/jemalloc/src/ctl.c @@ -51,7 +51,9 @@ CTL_PROTO(tcache_flush) CTL_PROTO(thread_arena) #ifdef JEMALLOC_STATS CTL_PROTO(thread_allocated) +CTL_PROTO(thread_allocatedp) CTL_PROTO(thread_deallocated) +CTL_PROTO(thread_deallocatedp) #endif CTL_PROTO(config_debug) CTL_PROTO(config_dss) @@ -230,7 +232,9 @@ static const ctl_node_t thread_node[] = { #ifdef JEMALLOC_STATS , {NAME("allocated"), CTL(thread_allocated)}, - {NAME("deallocated"), CTL(thread_deallocated)} + {NAME("allocatedp"), CTL(thread_allocatedp)}, + {NAME("deallocated"), CTL(thread_deallocated)}, + {NAME("deallocatedp"), CTL(thread_deallocatedp)} #endif }; @@ -1142,7 +1146,9 @@ RETURN: #ifdef JEMALLOC_STATS CTL_RO_NL_GEN(thread_allocated, ALLOCATED_GET(), uint64_t); +CTL_RO_NL_GEN(thread_allocatedp, &ALLOCATED_GET(), uint64_t *); CTL_RO_NL_GEN(thread_deallocated, DEALLOCATED_GET(), uint64_t); +CTL_RO_NL_GEN(thread_deallocatedp, &DEALLOCATED_GET(), uint64_t *); #endif /******************************************************************************/