Add stats counters for number of zero reallocs

This commit is contained in:
David T. Goldblatt
2019-10-26 11:04:46 -07:00
committed by David Goldblatt
parent 9cfa805947
commit de81a4eada
8 changed files with 81 additions and 2 deletions

View File

@@ -2451,6 +2451,21 @@ struct extent_hooks_s {
</para></listitem>
</varlistentry>
<varlistentry id="stats.zero_reallocs">
<term>
<mallctl>stats.zero_reallocs</mallctl>
(<type>size_t</type>)
<literal>r-</literal>
[<option>--enable-stats</option>]
</term>
<listitem><para>Number of times that the <function>realloc()</function>
was called with a non-<constant>NULL</constant> pointer argument and a
<constant>0</constant> size argument. This is a fundamentally unsafe
pattern in portable programs; see <link linkend="opt.zero_realloc">
<mallctl>opt.zero_realloc</mallctl></link> for details.
</para></listitem>
</varlistentry>
<varlistentry id="stats.background_thread.num_threads">
<term>
<mallctl>stats.background_thread.num_threads</mallctl>