free_aligned_sized

Defined in header <stdlib.h>
void free_aligned_sized( void* ptr, size_t alignment, size_t size);
(since C23)

If ptr is a null pointer or the result obtained from a call to aligned_alloc, where alignment is equal to the requested allocation alignment and size is equal to the requested allocation size, this function is equivalent to free(ptr). Otherwise, the behavior is undefined.

Note: The result of an malloc, calloc, or realloc call may not be passed to free_aligned_sized.

Parameters

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

Return value

(none)

Example

See also

aligned_alloc
(C11)
allocates aligned memory
(function)
free
deallocates previously allocated memory
(function)
free_sized
(C23)
deallocates previously allocated sized memory
(function)
malloc
allocates memory
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/c/memory/free_aligned_sized