diff options
author | aravind <aravind@fb.com> | 2014-05-05 22:16:56 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2014-05-12 17:46:03 (GMT) |
commit | fb7fe50a88ca9bde74e9a401ae17ad3b15bbae28 (patch) | |
tree | e11f2d87ef6721c9025e98bd7730d01b6f39f1da /doc | |
parent | 4bbd11b78932cdae1fe8a856141f5837f5b4c621 (diff) | |
download | jemalloc-fb7fe50a88ca9bde74e9a401ae17ad3b15bbae28.zip jemalloc-fb7fe50a88ca9bde74e9a401ae17ad3b15bbae28.tar.gz jemalloc-fb7fe50a88ca9bde74e9a401ae17ad3b15bbae28.tar.bz2 |
Add support for user-specified chunk allocators/deallocators.
Add new mallctl endpoints "arena<i>.chunk.alloc" and
"arena<i>.chunk.dealloc" to allow userspace to configure
jemalloc's chunk allocator and deallocator on a per-arena
basis.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/jemalloc.xml.in | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in index 78e9b3c..a7c38b5 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -1283,6 +1283,69 @@ malloc_conf = "xmalloc:true";]]></programlisting> </para></listitem> </varlistentry> + <varlistentry id="arena.i.chunk.alloc"> + <term> + <mallctl>arena.<i>.chunk.alloc</mallctl> + (<type>chunk_alloc_t *</type>) + <literal>rw</literal> + </term> + <listitem><para>Get or set the chunk allocation function for arena + <i>. If setting, the chunk deallocation function should + also be set via <link linkend="arena.i.chunk.dealloc"> + <mallctl>arena.<i>.chunk.dealloc</mallctl></link> to a companion + function that knows how to deallocate the chunks. + <funcprototype> + <funcdef>typedef void *<function>(chunk_alloc_t)</function></funcdef> + <paramdef>size_t <parameter>size</parameter></paramdef> + <paramdef>size_t <parameter>alignment</parameter></paramdef> + <paramdef>bool *<parameter>zero</parameter></paramdef> + <paramdef>unsigned <parameter>arena_ind</parameter></paramdef> + </funcprototype> + A chunk allocation function conforms to the <type>chunk_alloc_t</type> + type and upon success returns a pointer to <parameter>size</parameter> + bytes of memory on behalf of arena <parameter>arena_ind</parameter> such + that the chunk's base address is a multiple of + <parameter>alignment</parameter>, as well as setting + <parameter>*zero</parameter> to indicate whether the chunk is zeroed. + Upon error the function returns <constant>NULL</constant> and leaves + <parameter>*zero</parameter> unmodified. The + <parameter>size</parameter> parameter is always a multiple of the chunk + size. The <parameter>alignment</parameter> parameter is always a power + of two at least as large as the chunk size. Zeroing is mandatory if + <parameter>*zero</parameter> is true upon function + entry.</para></listitem> + </varlistentry> + + <varlistentry id="arena.i.chunk.dealloc"> + <term> + <mallctl>arena.<i>.chunk.dealloc</mallctl> + (<type>chunk_dealloc_t *</type>) + <literal>rw</literal> + </term> + <listitem><para>Get or set the chunk deallocation function for arena + <i>. If setting, the chunk deallocation function must + be capable of deallocating all extant chunks associated with arena + <i>, usually by passing unknown chunks to the deallocation + function that was replaced. In practice, it is feasible to control + allocation for arenas created via <link + linkend="arenas.extend"><mallctl>arenas.extend</mallctl></link> such + that all chunks originate from an application-supplied chunk allocator + (by setting custom chunk allocation/deallocation functions just after + arena creation), but the automatically created arenas may have already + created chunks prior to the application having an opportunity to take + over chunk allocation. + <funcprototype> + <funcdef>typedef void <function>(chunk_dealloc_t)</function></funcdef> + <paramdef>void *<parameter>chunk</parameter></paramdef> + <paramdef>size_t <parameter>size</parameter></paramdef> + <paramdef>unsigned <parameter>arena_ind</parameter></paramdef> + </funcprototype> + A chunk deallocation function conforms to the + <type>chunk_dealloc_t</type> type and deallocates a + <parameter>chunk</parameter> of given <parameter>size</parameter> on + behalf of arena <parameter>arena_ind</parameter>.</para></listitem> + </varlistentry> + <varlistentry id="arenas.narenas"> <term> <mallctl>arenas.narenas</mallctl> |