diff options
| author | Jason Evans <je@fb.com> | 2010-12-03 23:55:47 (GMT) |
|---|---|---|
| committer | Jason Evans <je@fb.com> | 2010-12-03 23:55:47 (GMT) |
| commit | ecf229a39fc253da39ae6baeab9f5c1955786ff6 (patch) | |
| tree | e4b860f2b3110f0ac77112d05efd4a6d7e3858c8 | |
| parent | cfdc8cfbd626e83d38417bd8c73ac018b611e390 (diff) | |
| download | jemalloc-ecf229a39fc253da39ae6baeab9f5c1955786ff6.zip jemalloc-ecf229a39fc253da39ae6baeab9f5c1955786ff6.tar.gz jemalloc-ecf229a39fc253da39ae6baeab9f5c1955786ff6.tar.bz2 | |
Add the "thread.[de]allocatedp" mallctl's.
| -rw-r--r-- | jemalloc/doc/jemalloc.xml.in | 30 | ||||
| -rw-r--r-- | 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 6951160..97893c1 100644 --- a/jemalloc/doc/jemalloc.xml.in +++ b/jemalloc/doc/jemalloc.xml.in @@ -1172,7 +1172,7 @@ malloc_conf = "xmalloc:true";]]></programlisting> calling this interface.</para></listitem> </varlistentry> - <varlistentry> + <varlistentry id="thread.allocated"> <term> <mallctl>thread.allocated</mallctl> (<type>uint64_t</type>) @@ -1187,6 +1187,20 @@ malloc_conf = "xmalloc:true";]]></programlisting> <varlistentry> <term> + <mallctl>thread.allocatedp</mallctl> + (<type>uint64_t *</type>) + <literal>r-</literal> + [<option>--enable-stats</option>] + </term> + <listitem><para>Get a pointer to the the value that is returned by the + <link + linkend="thread.allocated"><mallctl>thread.allocated</mallctl></link> + mallctl. This is useful for avoiding the overhead of repeated + <function>mallctl*<parameter/></function> calls.</para></listitem> + </varlistentry> + + <varlistentry id="thread.deallocated"> + <term> <mallctl>thread.deallocated</mallctl> (<type>uint64_t</type>) <literal>r-</literal> @@ -1198,6 +1212,20 @@ malloc_conf = "xmalloc:true";]]></programlisting> cases.</para></listitem> </varlistentry> + <varlistentry> + <term> + <mallctl>thread.deallocatedp</mallctl> + (<type>uint64_t *</type>) + <literal>r-</literal> + [<option>--enable-stats</option>] + </term> + <listitem><para>Get a pointer to the the value that is returned by the + <link + linkend="thread.deallocated"><mallctl>thread.deallocated</mallctl></link> + mallctl. This is useful for avoiding the overhead of repeated + <function>mallctl*<parameter/></function> calls.</para></listitem> + </varlistentry> + <varlistentry id="arenas.narenas"> <term> <mallctl>arenas.narenas</mallctl> diff --git a/jemalloc/src/ctl.c b/jemalloc/src/ctl.c index 0e10059..3c8adab 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 /******************************************************************************/ |
