summaryrefslogtreecommitdiff
path: root/devdocs/c/memory%2Ffree_aligned_sized.html
blob: f4aeba49cbf030411dc3a9096c794eba230b18dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    <h1 id="firstHeading" class="firstHeading">free_aligned_sized</h1>            <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;stdlib.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c23"> <td> <pre data-language="c">void free_aligned_sized( void* ptr, size_t alignment, size_t size);</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> </tr>  </table> <p>If <code>ptr</code> is a null pointer or the result obtained from a call to <code>aligned_alloc</code>, where <code>alignment</code> is equal to the requested allocation alignment and <code>size</code> is equal to the requested allocation size, this function is equivalent to <code><a href="http://en.cppreference.com/w/c/memory/free"><span class="kw406">free</span></a><span class="br0">(</span>ptr<span class="br0">)</span></code>. Otherwise, the behavior is undefined.</p>
<p>Note: The result of an <code><a href="malloc" title="c/memory/malloc">malloc</a></code>, <code><a href="calloc" title="c/memory/calloc">calloc</a></code>, or <code><a href="realloc" title="c/memory/realloc">realloc</a></code> call may not be passed to <code>free_aligned_sized</code>.</p>
<h3 id="Parameters"> Parameters</h3> <table class="t-par-begin"> <tr class="t-par"> <td> ptr </td> <td> - </td> <td> pointer to the memory to deallocate </td>
</tr> <tr class="t-par"> <td> alignment </td> <td> - </td> <td> alignment of memory to deallocate </td>
</tr> <tr class="t-par"> <td> size </td> <td> - </td> <td> size of memory to deallocate </td>
</tr>
</table> <h3 id="Return_value"> Return value</h3> <p>(none)</p>
<h3 id="Example"> Example</h3>  <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="aligned_alloc" title="c/memory/aligned alloc"> <span class="t-lines"><span>aligned_alloc</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c11">(C11)</span></span></span></div> </td> <td> allocates aligned memory <br> <span class="t-mark">(function)</span>  </td>
</tr> <tr class="t-dsc"> <td> <div><a href="free" title="c/memory/free"> <span class="t-lines"><span>free</span></span></a></div> </td> <td> deallocates previously allocated memory <br> <span class="t-mark">(function)</span>  </td>
</tr> <tr class="t-dsc"> <td> <div><a href="free_sized" title="c/memory/free sized"> <span class="t-lines"><span>free_sized</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c23">(C23)</span></span></span></div> </td> <td> deallocates previously allocated sized memory <br> <span class="t-mark">(function)</span>  </td>
</tr> <tr class="t-dsc"> <td> <div><a href="malloc" title="c/memory/malloc"> <span class="t-lines"><span>malloc</span></span></a></div> </td> <td> allocates memory <br> <span class="t-mark">(function)</span>  </td>
</tr> </table>           <div class="_attribution">
  <p class="_attribution-p">
    &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
    <a href="https://en.cppreference.com/w/c/memory/free_aligned_sized" class="_attribution-link">https://en.cppreference.com/w/c/memory/free_aligned_sized</a>
  </p>
</div>