You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<trclass="memdesc:gad823d23444a4b77a40f66bf075a98a0c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Type of output functions. <ahref="#gad823d23444a4b77a40f66bf075a98a0c">More...</a><br/></td></tr>
<trclass="memdesc:gae5b17ff027cd2150b43a33040250cf3f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register an output function. <ahref="#gae5b17ff027cd2150b43a33040250cf3f">More...</a><br/></td></tr>
<trclass="memdesc:ga5f071b10d4df1c3658e04e7fd67a94e6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is a pointer part of our heap? <ahref="#ga5f071b10d4df1c3658e04e7fd67a94e6">More...</a><br/></td></tr>
<tr><tdclass="paramname">err</td><td>Error code (see <aclass="el" href="group__extended.html#gaa1d55e0e894be240827e5d87ec3a1f45" title="Register an error callback function.">mi_register_error()</a> for a complete list). </td></tr>
252
+
<tr><tdclass="paramname">arg</td><td>Argument that was passed at registration to hold extra state.</td></tr>
253
+
</table>
254
+
</dd>
255
+
</dl>
256
+
<dlclass="section see"><dt>See also</dt><dd><aclass="el" href="group__extended.html#gaa1d55e0e894be240827e5d87ec3a1f45" title="Register an error callback function.">mi_register_error()</a></dd></dl>
<p>Some runtime systems use deferred free-ing, for example when using reference counting to limit the worst case free time. Such systems can register (re-entrant) deferred free function to free more memory on demand. When the <em>force</em> parameter is <em>true</em> all possible memory should be freed. The per-thread <em>heartbeat</em> parameter is monotonically increasing and guaranteed to be deterministic if the program allocates deterministically. The <em>deferred_free</em> function is guaranteed to be called deterministically after some number of allocations (regardless of freeing or available free memory). At most one <em>deferred_free</em> function can be active. </p>
<tr><tdclass="paramname">errfun</td><td>The error function that is called on an error (use <em>NULL</em> for default) </td></tr>
484
+
<tr><tdclass="paramname">arg</td><td>Extra argument that will be passed on to the error function.</td></tr>
485
+
</table>
486
+
</dd>
487
+
</dl>
488
+
<p>The <em>errfun</em> function is called on an error in mimalloc after emitting an error message (through the output function). It as always legal to just return from the <em>errfun</em> function in which case allocation functions generally return <em>NULL</em> or ignore the condition. The default function only calls abort() when compiled in secure mode with an <em>EFAULT</em> error. The possible error codes are:</p><ul>
489
+
<li><em>EAGAIN:</em> Double free was detected (only in debug and secure mode).</li>
490
+
<li><em>EFAULT:</em> Corrupted free list or meta-data was detected (only in debug and secure mode).</li>
491
+
<li><em>ENOMEM:</em> Not enough memory available to satisfy the request.</li>
492
+
<li><em>EOVERFLOW:</em> Too large a request, for example in <aclass="el" href="group__malloc.html#ga97fedb4f7107c592fd7f0f0a8949a57d" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a>, the <em>count</em> and <em>size</em> parameters are too large.</li>
493
+
<li><em>EINVAL:</em> Trying to free or re-allocate an invalid pointer. </li>
<trclass="memdesc:gae7bc4f56cd57ed3359060ff4f38bda81"><tdclass="mdescLeft"> </td><tdclass="mdescRight">raise <code>std::bad_alloc</code> exception on failure or overflow. <ahref="#gae7bc4f56cd57ed3359060ff4f38bda81">More...</a><br/></td></tr>
0 commit comments