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
<tr><tdclass="paramname">size</td><td>number of bytes to allocate. </td></tr>
217
-
<tr><tdclass="paramname">alignment</td><td>the minimal alignment of the allocated memory. </td></tr>
217
+
<tr><tdclass="paramname">alignment</td><td>the minimal alignment of the allocated memory. <br/>
218
+
</td></tr>
218
219
</table>
219
220
</dd>
220
221
</dl>
221
-
<dlclass="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory. The returned pointer is aligned by <em>alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>.</dd></dl>
222
-
<p>Returns a unique pointer if called with <em>size</em> 0. </p><dlclass="section see"><dt>See also</dt><dd><ahref="https://en.cppreference.com/w/c/memory/aligned_alloc">aligned_alloc</a> (in the standard C11 library, with switched arguments!) </dd>
222
+
<dlclass="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em>size</em> is unrestricted (and does not have to be an integral multiple of the <em>alignment</em>). The returned pointer is aligned by <em>alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em>size</em> 0.</dd></dl>
223
+
<p>Note that <code>alignment</code> always follows <code>size</code> for consistency with the unaligned allocation API, but unfortunately this differs from <code>posix_memalign</code> and <code>aligned_alloc</code> in the C library.</p>
224
+
<dlclass="section see"><dt>See also</dt><dd><ahref="https://en.cppreference.com/w/c/memory/aligned_alloc">aligned_alloc</a> (in the standard C11 library, with switched arguments!) </dd>
223
225
<dd>
224
226
<ahref="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-malloc?view=vs-2017">_aligned_malloc</a> (on Windows) </dd>
<dlclass="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory. The returned pointer is aligned by <em>alignment</em> at <em>offset</em>, i.e. <code>((uintptr_t)p + offset) % alignment == 0</code>.</dd></dl>
268
-
<p>Returns a unique pointer if called with <em>size</em> 0. </p><dlclass="section see"><dt>See also</dt><dd><ahref="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-offset-malloc?view=vs-2017">_aligned_offset_malloc</a> (on Windows) </dd></dl>
269
+
<dlclass="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em>size</em>is unrestricted (and does not have to be an integral multiple of the <em>alignment</em>). The returned pointer is aligned by <em>alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em>size</em> 0.</dd></dl>
270
+
<dlclass="section see"><dt>See also</dt><dd><ahref="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-offset-malloc?view=vs-2017">_aligned_offset_malloc</a> (on Windows) </dd></dl>
<p>Visit all areas and blocks in abandoned heaps. </p>
258
-
<p>Note: requires the option <code>mi_option_allow_visit_abandoned</code> to be set at the start of the program. </p>
264
+
<dlclass="params"><dt>Parameters</dt><dd>
265
+
<tableclass="params">
266
+
<tr><tdclass="paramname">subproc_id</td><td>The sub-process id associated with the abandonded heaps. </td></tr>
267
+
<tr><tdclass="paramname">heap_tag</td><td>Visit only abandoned memory with the specified heap tag, use -1 to visit all abandoned memory. </td></tr>
268
+
<tr><tdclass="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>
269
+
<tr><tdclass="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>
270
+
<tr><tdclass="paramname">arg</td><td>extra argument passed to the <em>visitor</em>. </td></tr>
271
+
</table>
272
+
</dd>
273
+
</dl>
274
+
<dlclass="section return"><dt>Returns</dt><dd><em>true</em> if all areas and blocks were visited.</dd></dl>
275
+
<p>Note: requires the option <code>mi_option_visit_abandoned</code> to be set at the start of the program. </p>
0 commit comments