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
<p>The maximum supported alignment size (currently 1MiB). </p>
157
-
158
-
</div>
159
-
</div>
135
+
<p>Allocating aligned memory blocks. 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>
<tr><tdclass="paramname">size</td><td>number of bytes to allocate. </td></tr>
241
-
<tr><tdclass="paramname">alignment</td><td>the minimal alignment of the allocated memory. Must be less than <aclass="el" href="#ga2e3fc59317bd730a71788c4d56ac8bff" title="The maximum supported alignment size (currently 1MiB).">MI_BLOCK_ALIGNMENT_MAX</a>. </td></tr>
217
+
<tr><tdclass="paramname">alignment</td><td>the minimal alignment of the allocated memory. </td></tr>
242
218
</table>
243
219
</dd>
244
220
</dl>
245
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>
246
-
<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-malloc?view=vs-2017">_aligned_malloc</a> (on Windows) </dd>
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>
223
+
<dd>
224
+
<ahref="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-malloc?view=vs-2017">_aligned_malloc</a> (on Windows) </dd>
247
225
<dd>
248
226
<ahref="http://man.openbsd.org/reallocarray">aligned_alloc</a> (on BSD, with switched arguments!) </dd>
0 commit comments