mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
update to v1.8.8
This commit is contained in:
parent
a0a6ad3cf9
commit
98699c983a
36 changed files with 694 additions and 433 deletions
|
@ -3,7 +3,7 @@
|
|||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<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"/>
|
||||
|
@ -54,7 +54,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
|
@ -119,37 +119,37 @@ Functions</h2></td></tr>
|
|||
<tr class="memdesc:gaf2c7b89c327d1f60f59e68b9ea644d95"><td class="mdescLeft"> </td><td class="mdescRight">Free previously allocated memory. <br /></td></tr>
|
||||
<tr class="separator:gaf2c7b89c327d1f60f59e68b9ea644d95"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae1dd97b542420c87ae085e822b1229e8" id="r_gae1dd97b542420c87ae085e822b1229e8"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae1dd97b542420c87ae085e822b1229e8">mi_malloc</a> (size_t size)</td></tr>
|
||||
<tr class="memdesc:gae1dd97b542420c87ae085e822b1229e8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:gae1dd97b542420c87ae085e822b1229e8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:gae1dd97b542420c87ae085e822b1229e8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae6e38c4403247a7b40d80419e093bfb8" id="r_gae6e38c4403247a7b40d80419e093bfb8"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae6e38c4403247a7b40d80419e093bfb8">mi_zalloc</a> (size_t size)</td></tr>
|
||||
<tr class="memdesc:gae6e38c4403247a7b40d80419e093bfb8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <code>size</code> bytes. <br /></td></tr>
|
||||
<tr class="separator:gae6e38c4403247a7b40d80419e093bfb8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6686568014b54d1e6c7ac64a076e4f56" id="r_ga6686568014b54d1e6c7ac64a076e4f56"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6686568014b54d1e6c7ac64a076e4f56">mi_calloc</a> (size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga6686568014b54d1e6c7ac64a076e4f56"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga6686568014b54d1e6c7ac64a076e4f56"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga6686568014b54d1e6c7ac64a076e4f56"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0621af6a5e3aa384e6a1b548958bf583" id="r_ga0621af6a5e3aa384e6a1b548958bf583"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0621af6a5e3aa384e6a1b548958bf583">mi_realloc</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga0621af6a5e3aa384e6a1b548958bf583"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>newsize</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga0621af6a5e3aa384e6a1b548958bf583"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">newsize</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga0621af6a5e3aa384e6a1b548958bf583"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga23a0fbb452b5dce8e31fab1a1958cacc" id="r_ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#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. <br /></td></tr>
|
||||
<tr class="memdesc:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes, with extra memory initialized to zero. <br /></td></tr>
|
||||
<tr class="separator:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga19299856216cfbb08e2628593654dfb0" id="r_ga19299856216cfbb08e2628593654dfb0"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga19299856216cfbb08e2628593654dfb0">mi_expand</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga19299856216cfbb08e2628593654dfb0"><td class="mdescLeft"> </td><td class="mdescRight">Try to re-allocate memory to <em>newsize</em> bytes <em>in place</em>. <br /></td></tr>
|
||||
<tr class="memdesc:ga19299856216cfbb08e2628593654dfb0"><td class="mdescLeft"> </td><td class="mdescRight">Try to re-allocate memory to <em class="arg">newsize</em> bytes <em>in place</em>. <br /></td></tr>
|
||||
<tr class="separator:ga19299856216cfbb08e2628593654dfb0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga61f46bade3db76ca24aaafedc40de7b6" id="r_ga61f46bade3db76ca24aaafedc40de7b6"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga61f46bade3db76ca24aaafedc40de7b6">mi_mallocn</a> (size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga61f46bade3db76ca24aaafedc40de7b6"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga61f46bade3db76ca24aaafedc40de7b6"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga61f46bade3db76ca24aaafedc40de7b6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga8bddfb4a1270a0854bbcf44cb3980467" id="r_ga8bddfb4a1270a0854bbcf44cb3980467"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga8bddfb4a1270a0854bbcf44cb3980467">mi_reallocn</a> (void *p, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga4dc3a4067037b151a64629fe8a332641" id="r_ga4dc3a4067037b151a64629fe8a332641"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga4dc3a4067037b151a64629fe8a332641">mi_reallocf</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga4dc3a4067037b151a64629fe8a332641"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>newsize</em> bytes,. <br /></td></tr>
|
||||
<tr class="memdesc:ga4dc3a4067037b151a64629fe8a332641"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">newsize</em> bytes,. <br /></td></tr>
|
||||
<tr class="separator:ga4dc3a4067037b151a64629fe8a332641"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga245ac90ebc2cfdd17de599e5fea59889" id="r_ga245ac90ebc2cfdd17de599e5fea59889"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga245ac90ebc2cfdd17de599e5fea59889">mi_strdup</a> (const char *s)</td></tr>
|
||||
<tr class="memdesc:ga245ac90ebc2cfdd17de599e5fea59889"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string. <br /></td></tr>
|
||||
<tr class="separator:ga245ac90ebc2cfdd17de599e5fea59889"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga486d0d26b3b3794f6d1cdb41a9aed92d" id="r_ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga486d0d26b3b3794f6d1cdb41a9aed92d">mi_strndup</a> (const char *s, size_t n)</td></tr>
|
||||
<tr class="memdesc:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string up to <em>n</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string up to <em class="arg">n</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga94c3afcc086e85d75a57e9f76b9b71dd" id="r_ga94c3afcc086e85d75a57e9f76b9b71dd"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga94c3afcc086e85d75a57e9f76b9b71dd">mi_realpath</a> (const char *fname, char *resolved_name)</td></tr>
|
||||
<tr class="memdesc:ga94c3afcc086e85d75a57e9f76b9b71dd"><td class="mdescLeft"> </td><td class="mdescRight">Resolve a file path name. <br /></td></tr>
|
||||
|
@ -177,7 +177,7 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate zero-initialized <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Allocate zero-initialized <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">count</td><td>number of elements. </td></tr>
|
||||
|
@ -185,8 +185,8 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</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="#gae6e38c4403247a7b40d80419e093bfb8" title="Allocate zero-initialized size bytes.">mi_zalloc()</a> </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory of <em class="arg">size*<em class="arg">count</em> bytes</em>, or <em class="arg">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 class="arg">size</em> or <em class="arg">count</em> of 0. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gae6e38c4403247a7b40d80419e093bfb8" title="Allocate zero-initialized size bytes.">mi_zalloc()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -209,15 +209,15 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Try to re-allocate memory to <em>newsize</em> bytes <em>in place</em>. </p>
|
||||
<p>Try to re-allocate memory to <em class="arg">newsize</em> bytes <em>in place</em>. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">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>pointer to the re-allocated memory of <em>newsize</em> bytes (always equal to <em>p</em>), or <em>NULL</em> if either out of memory or if the memory could not be expanded in place. If <em>NULL</em> is returned, the pointer <em>p</em> is not freed. Otherwise the original pointer is returned as the reallocated result since it fits in-place with the new size. 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. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes (always equal to <em class="arg">p</em>), or <em class="arg">NULL</em> if either out of memory or if the memory could not be expanded in place. If <em class="arg">NULL</em> is returned, the pointer <em class="arg">p</em> is not freed. Otherwise the original pointer is returned as the reallocated result since it fits in-place with the new size. If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">size</em> are uninitialized. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -237,9 +237,9 @@ Functions</h2></td></tr>
|
|||
</div><div class="memdoc">
|
||||
|
||||
<p>Free previously allocated memory. </p>
|
||||
<p>The pointer <code>p</code> must have been allocated before (or be <em>NULL</em>). </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>The pointer <code>p</code> must have been allocated before (or be <em class="arg">NULL</em>). </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to free, or <em>NULL</em>. </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to free, or <em class="arg">NULL</em>. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -261,14 +261,14 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>size</em> bytes. </p>
|
||||
<p>Allocate <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">size</td><td>number of bytes to allocate. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory. Returns a unique pointer if called with <em>size</em> 0. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em class="arg">NULL</em> if out of memory. Returns a unique pointer if called with <em class="arg">size</em> 0. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -291,7 +291,7 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Allocate <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
|
@ -299,7 +299,7 @@ Functions</h2></td></tr>
|
|||
</table>
|
||||
</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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_malloc(count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga6686568014b54d1e6c7ac64a076e4f56" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a> </dd>
|
||||
<dd>
|
||||
mi_zallocn() </dd></dl>
|
||||
|
@ -325,15 +325,15 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>newsize</em> bytes. </p>
|
||||
<p>Re-allocate memory to <em class="arg">newsize</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">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>pointer to the re-allocated memory of <em>newsize</em> bytes, or <em>NULL</em> if out of memory. If <em>NULL</em> is returned, the pointer <em>p</em> is not freed. 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. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes, or <em class="arg">NULL</em> if out of memory. If <em class="arg">NULL</em> is returned, the pointer <em class="arg">p</em> is not freed. 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 class="arg">p</em> is <em class="arg">NULL</em>, it behaves as <em class="arg">mi_malloc</em>(<em class="arg">newsize</em>). If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">size</em> are uninitialized. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -356,16 +356,16 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>newsize</em> bytes,. </p>
|
||||
<p>Re-allocate memory to <em class="arg">newsize</em> bytes,. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">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>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="#ga0621af6a5e3aa384e6a1b548958bf583" 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 return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes, or <em class="arg">NULL</em> if out of memory.</dd></dl>
|
||||
<p>In contrast to <a class="el" href="#ga0621af6a5e3aa384e6a1b548958bf583" title="Re-allocate memory to newsize bytes.">mi_realloc()</a>, if <em class="arg">NULL</em> is returned, the original pointer <em class="arg">p</em> is freed (if it was not <em class="arg">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 class="arg">p</em> is <em class="arg">NULL</em>, it behaves as <em class="arg">mi_malloc</em>(<em class="arg">newsize</em>). If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">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>
|
||||
|
@ -394,16 +394,16 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </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">p</td><td>Pointer to a previously allocated block (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
<tr><td class="paramname">size</td><td>The size of each element. </td></tr>
|
||||
</table>
|
||||
</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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">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 href="http://man.openbsd.org/reallocarray">reallocarray()</a> (on BSD) </dd></dl>
|
||||
|
||||
</div>
|
||||
|
@ -431,13 +431,13 @@ mi_zallocn() </dd></dl>
|
|||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">fname</td><td>File name. </td></tr>
|
||||
<tr><td class="paramname">resolved_name</td><td>Should be <em>NULL</em> (but can also point to a buffer of at least <em>PATH_MAX</em> bytes). </td></tr>
|
||||
<tr><td class="paramname">resolved_name</td><td>Should be <em class="arg">NULL</em> (but can also point to a buffer of at least <em class="arg">PATH_MAX</em> bytes). </td></tr>
|
||||
</table>
|
||||
</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="#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="#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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>If successful a pointer to the resolved absolute file name, or <em class="arg">NULL</em> on failure (with <em class="arg">errno</em> set to the error code).</dd></dl>
|
||||
<p>If <em class="arg">resolved_name</em> was <em class="arg">NULL</em>, the returned result should be freed with <a class="el" href="#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="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result (if <em class="arg">resolved_name</em> was <em class="arg">NULL</em>). </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -465,16 +465,16 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>count</em> elements of <em>size</em> bytes, with extra memory initialized to zero. </p>
|
||||
<p>Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</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">p</td><td>Pointer to a previously allocated block (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
<tr><td class="paramname">size</td><td>The size of each element. </td></tr>
|
||||
</table>
|
||||
</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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">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="#ga8bddfb4a1270a0854bbcf44cb3980467" 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>
|
||||
|
@ -499,11 +499,11 @@ mi_zallocn() </dd></dl>
|
|||
<p>Allocate and duplicate a string. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em class="arg">NULL</em>). </td></tr>
|
||||
</table>
|
||||
</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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em class="arg">s</em>, or <em class="arg">NULL</em> if either out of memory or if <em class="arg">s</em> is <em class="arg">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="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
|
@ -527,15 +527,15 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate and duplicate a string up to <em>n</em> bytes. </p>
|
||||
<p>Allocate and duplicate a string up to <em class="arg">n</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">n</td><td>maximum number of bytes to copy (excluding the terminating zero). </td></tr>
|
||||
</table>
|
||||
</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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em class="arg">s</em> up to the first <em class="arg">n</em> bytes (and always zero terminated), or <em class="arg">NULL</em> if either out of memory or if <em class="arg">s</em> is <em class="arg">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="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
|
@ -562,7 +562,7 @@ mi_zallocn() </dd></dl>
|
|||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Pointer to newly allocated zero initialized memory, or <em>NULL</em> if out of memory. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Pointer to newly allocated zero initialized memory, or <em class="arg">NULL</em> if out of memory. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -571,7 +571,7 @@ mi_zallocn() </dd></dl>
|
|||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue