Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      free_aligned_sized

      From cppreference.com
      <c‎ |memory
       
       
       
      Defined in header<stdlib.h>
      void free_aligned_sized(void* ptr,size_t alignment,size_t size);
      (since C23)

      Ifptr is a null pointer or the result obtained from a call toaligned_alloc, wherealignment is equal to the requested allocation alignment andsize is equal to the requested allocation size, this function is equivalent tofree(ptr). Otherwise, the behavior is undefined.

      The result of anmalloc,calloc, orrealloc call may not be passed tofree_aligned_sized.

      free_aligned_sized is thread-safe: it behaves as though only accessing the memory locations visible through its argument, and not any static storage.

      A call tofree_aligned_sized that deallocates a region of memorysynchronizes-with a call to any subsequent allocation function that allocates the same or a part of the same region of memory. This synchronization occurs after any access to the memory by the deallocating function and before any access to the memory by the allocation function. There is a single total order of all allocation and deallocation functions operating on each particular region of memory.

      Contents

      [edit]Parameters

      ptr - pointer to the memory to deallocate
      alignment - alignment of memory to deallocate
      size - size of memory to deallocate

      [edit]Return value

      (none)

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]References

      • C23 standard (ISO/IEC 9899:2024):
      • 7.24.3.5 The free_sized function (p: 366)

      [edit]See also

      allocates aligned memory
      (function)[edit]
      deallocates previously allocated memory
      (function)[edit]
      deallocates previously allocated sized memory
      (function)[edit]
      allocates memory
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/memory/free_aligned_sized&oldid=175230"

      [8]ページ先頭

      ©2009-2025 Movatter.jp