427 lines
24 KiB
HTML
427 lines
24 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.11.0"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>mi-malloc: Heap Introspection</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { init_search(); });
|
|
/* @license-end */
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="mimalloc-doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectlogo"><img alt="Logo" src="mimalloc-logo.svg"/></td>
|
|
<td id="projectalign">
|
|
<div id="projectname">mi-malloc<span id="projectnumber"> 1.8/2.1</span>
|
|
</div>
|
|
</td>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.11.0 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('group__analysis.html',''); initResizable(true); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Data Structures</a> |
|
|
<a href="#typedef-members">Typedefs</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle"><div class="title">Heap Introspection</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:structmi__heap__area__t" id="r_structmi__heap__area__t"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="#structmi__heap__area__t">mi_heap_area_t</a></td></tr>
|
|
<tr class="memdesc:structmi__heap__area__t"><td class="mdescLeft"> </td><td class="mdescRight">An area of heap space contains blocks of a single size. <a href="#structmi__heap__area__t">More...</a><br /></td></tr>
|
|
<tr class="separator:structmi__heap__area__t"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
|
Typedefs</h2></td></tr>
|
|
<tr class="memitem:ga8255dc9371e6b299d9802a610c4e34ec" id="r_ga8255dc9371e6b299d9802a610c4e34ec"><td class="memItemLeft" align="right" valign="top">typedef bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga8255dc9371e6b299d9802a610c4e34ec">mi_block_visit_fun</a>(const <a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const <a class="el" href="#structmi__heap__area__t">mi_heap_area_t</a> *area, void *block, size_t block_size, void *arg)</td></tr>
|
|
<tr class="memdesc:ga8255dc9371e6b299d9802a610c4e34ec"><td class="mdescLeft"> </td><td class="mdescRight">Visitor function passed to <a class="el" href="#ga70c46687dc6e9dc98b232b02646f8bed" title="Visit all areas and blocks in a heap.">mi_heap_visit_blocks()</a> <br /></td></tr>
|
|
<tr class="separator:ga8255dc9371e6b299d9802a610c4e34ec"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:gaa862aa8ed8d57d84cae41fc1022d71af" id="r_gaa862aa8ed8d57d84cae41fc1022d71af"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa862aa8ed8d57d84cae41fc1022d71af">mi_heap_contains_block</a> (<a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const void *p)</td></tr>
|
|
<tr class="memdesc:gaa862aa8ed8d57d84cae41fc1022d71af"><td class="mdescLeft"> </td><td class="mdescRight">Does a heap contain a pointer to a previously allocated block? <br /></td></tr>
|
|
<tr class="separator:gaa862aa8ed8d57d84cae41fc1022d71af"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga0d67c1789faaa15ff366c024fcaf6377" id="r_ga0d67c1789faaa15ff366c024fcaf6377"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0d67c1789faaa15ff366c024fcaf6377">mi_heap_check_owned</a> (<a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const void *p)</td></tr>
|
|
<tr class="memdesc:ga0d67c1789faaa15ff366c024fcaf6377"><td class="mdescLeft"> </td><td class="mdescRight">Check safely if any pointer is part of a heap. <br /></td></tr>
|
|
<tr class="separator:ga0d67c1789faaa15ff366c024fcaf6377"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga628c237489c2679af84a4d0d143b3dd5" id="r_ga628c237489c2679af84a4d0d143b3dd5"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga628c237489c2679af84a4d0d143b3dd5">mi_check_owned</a> (const void *p)</td></tr>
|
|
<tr class="memdesc:ga628c237489c2679af84a4d0d143b3dd5"><td class="mdescLeft"> </td><td class="mdescRight">Check safely if any pointer is part of the default heap of this thread. <br /></td></tr>
|
|
<tr class="separator:ga628c237489c2679af84a4d0d143b3dd5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga70c46687dc6e9dc98b232b02646f8bed" id="r_ga70c46687dc6e9dc98b232b02646f8bed"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga70c46687dc6e9dc98b232b02646f8bed">mi_heap_visit_blocks</a> (const <a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, bool visit_all_blocks, <a class="el" href="#ga8255dc9371e6b299d9802a610c4e34ec">mi_block_visit_fun</a> *visitor, void *arg)</td></tr>
|
|
<tr class="memdesc:ga70c46687dc6e9dc98b232b02646f8bed"><td class="mdescLeft"> </td><td class="mdescRight">Visit all areas and blocks in a heap. <br /></td></tr>
|
|
<tr class="separator:ga70c46687dc6e9dc98b232b02646f8bed"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga6a4865a887b2ec5247854af61562503c" id="r_ga6a4865a887b2ec5247854af61562503c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6a4865a887b2ec5247854af61562503c">mi_abandoned_visit_blocks</a> (<a class="el" href="group__extended.html#ga8c0bcd1fee27c7641e9c3c0d991b3b7d">mi_subproc_id_t</a> subproc_id, int heap_tag, bool visit_blocks, <a class="el" href="#ga8255dc9371e6b299d9802a610c4e34ec">mi_block_visit_fun</a> *visitor, void *arg)</td></tr>
|
|
<tr class="memdesc:ga6a4865a887b2ec5247854af61562503c"><td class="mdescLeft"> </td><td class="mdescRight">Visit all areas and blocks in abandoned heaps. <br /></td></tr>
|
|
<tr class="separator:ga6a4865a887b2ec5247854af61562503c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p>Inspect the heap at runtime. </p>
|
|
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
|
|
<a name="structmi__heap__area__t" id="structmi__heap__area__t"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#structmi__heap__area__t">◆ </a></span>mi_heap_area_t</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct mi_heap_area_t</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<div class="textblock"><p>An area of heap space contains blocks of a single size. </p>
|
|
<p>The bytes in freed blocks are <code>committed - used</code>. </p>
|
|
</div><table class="fieldtable">
|
|
<tr><th colspan="3">Data Fields</th></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="a332a6c14d736a99699d5453a1cb04b41" name="a332a6c14d736a99699d5453a1cb04b41"></a>size_t</td>
|
|
<td class="fieldname">
|
|
block_size</td>
|
|
<td class="fielddoc">
|
|
size in bytes of one block </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="ae0085e6e1cf059a4eb7767e30e9991b8" name="ae0085e6e1cf059a4eb7767e30e9991b8"></a>void *</td>
|
|
<td class="fieldname">
|
|
blocks</td>
|
|
<td class="fielddoc">
|
|
start of the area containing heap blocks </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="ab47526df656d8837ec3e97f11b83f835" name="ab47526df656d8837ec3e97f11b83f835"></a>size_t</td>
|
|
<td class="fieldname">
|
|
committed</td>
|
|
<td class="fielddoc">
|
|
current committed bytes of this area </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="ab53664e31d7fe2564f8d42041ef75cb3" name="ab53664e31d7fe2564f8d42041ef75cb3"></a>size_t</td>
|
|
<td class="fieldname">
|
|
full_block_size</td>
|
|
<td class="fielddoc">
|
|
size in bytes of a full block including padding and metadata. </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="a2b7a0c92ece8daf46b558efc990ebdc1" name="a2b7a0c92ece8daf46b558efc990ebdc1"></a>int</td>
|
|
<td class="fieldname">
|
|
heap_tag</td>
|
|
<td class="fielddoc">
|
|
heap tag associated with this area (see <em>mi_heap_new_ex</em>) </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="ae848a3e6840414891035423948ca0383" name="ae848a3e6840414891035423948ca0383"></a>size_t</td>
|
|
<td class="fieldname">
|
|
reserved</td>
|
|
<td class="fielddoc">
|
|
bytes reserved for this area </td></tr>
|
|
<tr><td class="fieldtype">
|
|
<a id="ab820302c5cd0df133eb8e51650a008b4" name="ab820302c5cd0df133eb8e51650a008b4"></a>size_t</td>
|
|
<td class="fieldname">
|
|
used</td>
|
|
<td class="fielddoc">
|
|
bytes in use by allocated blocks </td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Typedef Documentation</h2>
|
|
<a id="ga8255dc9371e6b299d9802a610c4e34ec" name="ga8255dc9371e6b299d9802a610c4e34ec"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8255dc9371e6b299d9802a610c4e34ec">◆ </a></span>mi_block_visit_fun</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef bool mi_block_visit_fun(const <a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const <a class="el" href="#structmi__heap__area__t">mi_heap_area_t</a> *area, void *block, size_t block_size, void *arg)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Visitor function passed to <a class="el" href="#ga70c46687dc6e9dc98b232b02646f8bed" title="Visit all areas and blocks in a heap.">mi_heap_visit_blocks()</a> </p>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if ok, <em>false</em> to stop visiting (i.e. break)</dd></dl>
|
|
<p>This function is always first called for every <em>area</em> with <em>block</em> as a <em>NULL</em> pointer. If <em>visit_all_blocks</em> was <em>true</em>, the function is then called for every allocated block in that area. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="ga6a4865a887b2ec5247854af61562503c" name="ga6a4865a887b2ec5247854af61562503c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6a4865a887b2ec5247854af61562503c">◆ </a></span>mi_abandoned_visit_blocks()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool mi_abandoned_visit_blocks </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__extended.html#ga8c0bcd1fee27c7641e9c3c0d991b3b7d">mi_subproc_id_t</a></td> <td class="paramname"><span class="paramname"><em>subproc_id</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>heap_tag</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>visit_blocks</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="#ga8255dc9371e6b299d9802a610c4e34ec">mi_block_visit_fun</a> *</td> <td class="paramname"><span class="paramname"><em>visitor</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>arg</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Visit all areas and blocks in abandoned heaps. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">subproc_id</td><td>The sub-process id associated with the abandonded heaps. </td></tr>
|
|
<tr><td class="paramname">heap_tag</td><td>Visit only abandoned memory with the specified heap tag, use -1 to visit all abandoned memory. </td></tr>
|
|
<tr><td class="paramname">visit_blocks</td><td>If <em>true</em> visits all allocated blocks, otherwise <em>visitor</em> is only called for every heap area. </td></tr>
|
|
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em>block</em> as <em>NULL</em>). If <em>visit_all_blocks</em> is <em>true</em>, <em>visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em>false</em> from this function to stop visiting early. </td></tr>
|
|
<tr><td class="paramname">arg</td><td>extra argument passed to the <em>visitor</em>. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if all areas and blocks were visited.</dd></dl>
|
|
<p>Note: requires the option <code>mi_option_visit_abandoned</code> to be set at the start of the program. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga628c237489c2679af84a4d0d143b3dd5" name="ga628c237489c2679af84a4d0d143b3dd5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga628c237489c2679af84a4d0d143b3dd5">◆ </a></span>mi_check_owned()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool mi_check_owned </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>p</em></span></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check safely if any pointer is part of the default heap of this thread. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">p</td><td>Any pointer – not required to be previously allocated by us. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if <em>p</em> points to a block in default heap of this thread.</dd></dl>
|
|
<p>Note: expensive function, linear in the pages in the heap. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gaa862aa8ed8d57d84cae41fc1022d71af" title="Does a heap contain a pointer to a previously allocated block?">mi_heap_contains_block()</a> </dd>
|
|
<dd>
|
|
<a class="el" href="group__heap.html#ga14c667a6e2c5d28762d8cb7d4e057909" title="Get the default heap that is used for mi_malloc() et al.">mi_heap_get_default()</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga0d67c1789faaa15ff366c024fcaf6377" name="ga0d67c1789faaa15ff366c024fcaf6377"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga0d67c1789faaa15ff366c024fcaf6377">◆ </a></span>mi_heap_check_owned()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool mi_heap_check_owned </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *</td> <td class="paramname"><span class="paramname"><em>heap</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>p</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check safely if any pointer is part of a heap. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">heap</td><td>The heap. </td></tr>
|
|
<tr><td class="paramname">p</td><td>Any pointer – not required to be previously allocated by us. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if <em>p</em> points to a block in <em>heap</em>.</dd></dl>
|
|
<p>Note: expensive function, linear in the pages in the heap. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gaa862aa8ed8d57d84cae41fc1022d71af" title="Does a heap contain a pointer to a previously allocated block?">mi_heap_contains_block()</a> </dd>
|
|
<dd>
|
|
<a class="el" href="group__heap.html#ga14c667a6e2c5d28762d8cb7d4e057909" title="Get the default heap that is used for mi_malloc() et al.">mi_heap_get_default()</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gaa862aa8ed8d57d84cae41fc1022d71af" name="gaa862aa8ed8d57d84cae41fc1022d71af"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gaa862aa8ed8d57d84cae41fc1022d71af">◆ </a></span>mi_heap_contains_block()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool mi_heap_contains_block </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *</td> <td class="paramname"><span class="paramname"><em>heap</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void *</td> <td class="paramname"><span class="paramname"><em>p</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Does a heap contain a pointer to a previously allocated block? </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">heap</td><td>The heap. </td></tr>
|
|
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (in any heap)– cannot be some random pointer! </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if the block pointed to by <em>p</em> is in the <em>heap</em>. </dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga0d67c1789faaa15ff366c024fcaf6377" title="Check safely if any pointer is part of a heap.">mi_heap_check_owned()</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga70c46687dc6e9dc98b232b02646f8bed" name="ga70c46687dc6e9dc98b232b02646f8bed"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga70c46687dc6e9dc98b232b02646f8bed">◆ </a></span>mi_heap_visit_blocks()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool mi_heap_visit_blocks </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *</td> <td class="paramname"><span class="paramname"><em>heap</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>visit_all_blocks</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="#ga8255dc9371e6b299d9802a610c4e34ec">mi_block_visit_fun</a> *</td> <td class="paramname"><span class="paramname"><em>visitor</em></span>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>arg</em></span> )</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Visit all areas and blocks in a heap. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">heap</td><td>The heap to visit. </td></tr>
|
|
<tr><td class="paramname">visit_all_blocks</td><td>If <em>true</em> visits all allocated blocks, otherwise <em>visitor</em> is only called for every heap area. </td></tr>
|
|
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em>block</em> as <em>NULL</em>). If <em>visit_all_blocks</em> is <em>true</em>, <em>visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em>false</em> from this function to stop visiting early. </td></tr>
|
|
<tr><td class="paramname">arg</td><td>Extra argument passed to <em>visitor</em>. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if all areas and blocks were visited. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|