mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
update documentation
This commit is contained in:
parent
d656f3e339
commit
5f607e0f58
76 changed files with 1770 additions and 672 deletions
|
@ -1,9 +1,9 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!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">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.14"/>
|
||||
<meta name="generator" content="Doxygen 1.8.15"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Basic Allocation</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
|
@ -60,7 +60,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.14 -->
|
||||
<!-- Generated by Doxygen 1.8.15 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
|
@ -125,12 +125,9 @@ Functions</h2></td></tr>
|
|||
<tr class="memitem:gaf11eb497da57bdfb2de65eb191c69db6"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__malloc.html#gaf11eb497da57bdfb2de65eb191c69db6">mi_realloc</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:gaf11eb497da57bdfb2de65eb191c69db6"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>newsize</em> bytes. <a href="#gaf11eb497da57bdfb2de65eb191c69db6">More...</a><br /></td></tr>
|
||||
<tr class="separator:gaf11eb497da57bdfb2de65eb191c69db6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga8c292e142110229a2980b37ab036dbc6"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__malloc.html#ga8c292e142110229a2980b37ab036dbc6">mi_rezalloc</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga8c292e142110229a2980b37ab036dbc6"><td class="mdescLeft"> </td><td class="mdescRight">Reallocate memory to <em>newsize</em> bytes, with extra memory initialized to zero. <a href="#ga8c292e142110229a2980b37ab036dbc6">More...</a><br /></td></tr>
|
||||
<tr class="separator:ga8c292e142110229a2980b37ab036dbc6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga381641d2f98e1e7863ac9e3960dab6c1"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__malloc.html#ga381641d2f98e1e7863ac9e3960dab6c1">mi_recalloc</a> (void *p, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga381641d2f98e1e7863ac9e3960dab6c1"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>count</em> elements of <em>size</em> bytes, with extra memory initialized to zero. <a href="#ga381641d2f98e1e7863ac9e3960dab6c1">More...</a><br /></td></tr>
|
||||
<tr class="separator:ga381641d2f98e1e7863ac9e3960dab6c1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__malloc.html#ga23a0fbb452b5dce8e31fab1a1958cacc">mi_recalloc</a> (void *p, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>count</em> elements of <em>size</em> bytes, with extra memory initialized to zero. <a href="#ga23a0fbb452b5dce8e31fab1a1958cacc">More...</a><br /></td></tr>
|
||||
<tr class="separator:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaaee66a1d483c3e28f585525fb96707e4"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__malloc.html#gaaee66a1d483c3e28f585525fb96707e4">mi_expand</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:gaaee66a1d483c3e28f585525fb96707e4"><td class="mdescLeft"> </td><td class="mdescRight">Try to re-allocate memory to <em>newsize</em> bytes <em>in place</em>. <a href="#gaaee66a1d483c3e28f585525fb96707e4">More...</a><br /></td></tr>
|
||||
<tr class="separator:gaaee66a1d483c3e28f585525fb96707e4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
|
@ -191,7 +188,7 @@ Functions</h2></td></tr>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory of <em>size*<em>count</em> bytes</em>, or <em>NULL</em> if either out of memory or when <code>count*size</code> overflows.</dd></dl>
|
||||
<p>Returns a unique pointer if called with either <em>size</em> or <em>count</em> of 0. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#gafdd9d8bb2986e668ba9884f28af38000" title="Allocate zero-initialized size bytes. ">mi_zalloc()</a> </dd></dl>
|
||||
<p>Returns a unique pointer if called with either <em>size</em> or <em>count</em> of 0. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#gafdd9d8bb2986e668ba9884f28af38000" title="Allocate zero-initialized size bytes.">mi_zalloc()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -321,7 +318,7 @@ Functions</h2></td></tr>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_malloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga97fedb4f7107c592fd7f0f0a8949a57d" title="Allocate zero-initialized count elements of size bytes. ">mi_calloc()</a> </dd>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_malloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga97fedb4f7107c592fd7f0f0a8949a57d" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a> </dd>
|
||||
<dd>
|
||||
mi_zallocn() </dd></dl>
|
||||
|
||||
|
@ -400,7 +397,7 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em>newsize</em> bytes, or <em>NULL</em> if out of memory.</dd></dl>
|
||||
<p>In contrast to <a class="el" href="group__malloc.html#gaf11eb497da57bdfb2de65eb191c69db6" title="Re-allocate memory to newsize bytes. ">mi_realloc()</a>, if <em>NULL</em> is returned, the original pointer <em>p</em> is freed (if it was not <em>NULL</em> itself). Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em>p</em> is <em>NULL</em>, it behaves as <em>mi_malloc</em>(<em>newsize</em>). If <em>newsize</em> is larger than the original <em>size</em> allocated for <em>p</em>, the bytes after <em>size</em> are uninitialized.</p>
|
||||
<p>In contrast to <a class="el" href="group__malloc.html#gaf11eb497da57bdfb2de65eb191c69db6" title="Re-allocate memory to newsize bytes.">mi_realloc()</a>, if <em>NULL</em> is returned, the original pointer <em>p</em> is freed (if it was not <em>NULL</em> itself). Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em>p</em> is <em>NULL</em>, it behaves as <em>mi_malloc</em>(<em>newsize</em>). If <em>newsize</em> is larger than the original <em>size</em> allocated for <em>p</em>, the bytes after <em>size</em> are uninitialized.</p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://www.freebsd.org/cgi/man.cgi?query=reallocf">reallocf</a> (on BSD) </dd></dl>
|
||||
|
||||
</div>
|
||||
|
@ -447,9 +444,7 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_realloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga381641d2f98e1e7863ac9e3960dab6c1" title="Re-allocate memory to count elements of size bytes, with extra memory initialized to zero...">mi_recalloc()</a> </dd>
|
||||
<dd>
|
||||
<a href="http://man.openbsd.org/reallocarray">reallocarray()</a> (on BSD) </dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_realloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a href="http://man.openbsd.org/reallocarray">reallocarray()</a> (on BSD) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -488,19 +483,19 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>If successful a pointer to the resolved absolute file name, or <em>NULL</em> on failure (with <em>errno</em> set to the error code).</dd></dl>
|
||||
<p>If <em>resolved_name</em> was <em>NULL</em>, the returned result should be freed with <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory. ">mi_free()</a>.</p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html">realpath()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory. ">mi_free()</a> can be used on the returned result (if <em>resolved_name</em> was <em>NULL</em>). </p>
|
||||
<p>If <em>resolved_name</em> was <em>NULL</em>, the returned result should be freed with <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a>.</p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html">realpath()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result (if <em>resolved_name</em> was <em>NULL</em>). </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="ga381641d2f98e1e7863ac9e3960dab6c1"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ga381641d2f98e1e7863ac9e3960dab6c1">◆ </a></span>mi_recalloc()</h2>
|
||||
<a id="ga23a0fbb452b5dce8e31fab1a1958cacc"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ga23a0fbb452b5dce8e31fab1a1958cacc">◆ </a></span>mi_recalloc()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void* mi_recalloc </td>
|
||||
<td class="memname">void * mi_recalloc </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">void * </td>
|
||||
<td class="paramname"><em>p</em>, </td>
|
||||
|
@ -535,51 +530,10 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_rezalloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga61d57b4144ba24fba5c1e9b956d13853" title="Re-allocate memory to count elements of size bytes. ">mi_reallocn()</a> </dd>
|
||||
<dd>
|
||||
<a class="el" href="group__malloc.html#ga8c292e142110229a2980b37ab036dbc6" title="Reallocate memory to newsize bytes, with extra memory initialized to zero. ">mi_rezalloc()</a> </dd>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_rezalloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga61d57b4144ba24fba5c1e9b956d13853" title="Re-allocate memory to count elements of size bytes.">mi_reallocn()</a> </dd>
|
||||
<dd>
|
||||
<a href="http://man.openbsd.org/reallocarray">recallocarray()</a> (on BSD). </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="ga8c292e142110229a2980b37ab036dbc6"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ga8c292e142110229a2980b37ab036dbc6">◆ </a></span>mi_rezalloc()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void* mi_rezalloc </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">void * </td>
|
||||
<td class="paramname"><em>p</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">size_t </td>
|
||||
<td class="paramname"><em>newsize</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Reallocate memory to <em>newsize</em> bytes, with extra memory initialized to zero. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">newsize</td><td>The new required size in bytes. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em>newsize</em> bytes, or <em>NULL</em> if out of memory.</dd></dl>
|
||||
<p>If the <em>newsize</em> is larger than the original allocated size of <em>p</em>, the extra bytes are initialized to zero. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="gac7cffe13f1f458ed16789488bf92b9b2"></a>
|
||||
|
@ -606,7 +560,7 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em>s</em>, or <em>NULL</em> if either out of memory or if <em>s</em> is <em>NULL</em>.</dd></dl>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html">strdup()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory. ">mi_free()</a> can be used on the returned result. </p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html">strdup()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -645,7 +599,7 @@ mi_zallocn() </dd></dl>
|
|||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em>s</em> up to the first <em>n</em> bytes (and always zero terminated), or <em>NULL</em> if either out of memory or if <em>s</em> is <em>NULL</em>.</dd></dl>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strndup.html">strndup()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory. ">mi_free()</a> can be used on the returned result. </p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strndup.html">strndup()</a> such that <a class="el" href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -683,7 +637,7 @@ mi_zallocn() </dd></dl>
|
|||
<ul>
|
||||
<li class="footer">Generated by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue