diff options
author | Jason Evans <jasone@canonware.com> | 2017-04-27 15:51:35 -0700 |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-04-29 09:24:12 -0700 |
commit | c86c8f4ffbf8c118203f7327610a2ad80cf9622c (patch) | |
tree | 88d2dd9f195a744e2da0f1f1cad9f718abd7872f /doc | |
parent | b9ab04a191dbcb9246d5180fc7ae822a85861939 (diff) |
Add extent_destroy_t and use it during arena destruction.
Add the extent_destroy_t extent destruction hook to extent_hooks_t, and
use it during arena destruction. This hook explicitly communicates to
the callee that the extent must be destroyed or tracked for later reuse,
lest it be permanently leaked. Prior to this change, retained extents
could unintentionally be leaked if extent retention was enabled.
This resolves #560.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/jemalloc.xml.in | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in index fa65c39b..d1b2e334 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -1605,6 +1605,7 @@ typedef extent_hooks_s extent_hooks_t; struct extent_hooks_s { extent_alloc_t *alloc; extent_dalloc_t *dalloc; + extent_destroy_t *destroy; extent_commit_t *commit; extent_decommit_t *decommit; extent_purge_t *purge_lazy; @@ -1682,6 +1683,25 @@ struct extent_hooks_s { in which case it will be automatically retained for later reuse.</para> <funcsynopsis><funcprototype> + <funcdef>typedef void <function>(extent_destroy_t)</function></funcdef> + <paramdef>extent_hooks_t *<parameter>extent_hooks</parameter></paramdef> + <paramdef>void *<parameter>addr</parameter></paramdef> + <paramdef>size_t <parameter>size</parameter></paramdef> + <paramdef>bool <parameter>committed</parameter></paramdef> + <paramdef>unsigned <parameter>arena_ind</parameter></paramdef> + </funcprototype></funcsynopsis> + <literallayout></literallayout> + <para> + An extent destruction function conforms to the + <type>extent_destroy_t</type> type and unconditionally destroys an + extent at given <parameter>addr</parameter> and + <parameter>size</parameter> with + <parameter>committed</parameter>/decommited memory as indicated, on + behalf of arena <parameter>arena_ind</parameter>. This function may be + called to destroy retained extents during arena destruction (see <link + linkend="arena.i.destroy"><mallctl>arena.<i>.destroy</mallctl></link>).</para> + + <funcsynopsis><funcprototype> <funcdef>typedef bool <function>(extent_commit_t)</function></funcdef> <paramdef>extent_hooks_t *<parameter>extent_hooks</parameter></paramdef> <paramdef>void *<parameter>addr</parameter></paramdef> |