You copied the Doc URL to your clipboard.
posix_memalign()
Defined in stdlib.h, the posix_memalign()
function provides aligned memory allocation.
This function is fully POSIX-compliant.
Syntax
int
posix_memalign(void
**memptr
, size_talignment
, size_tsize
);
Usage
This function allocates
bytes
of memory at an address that is a multiple of size
.alignment
The value of
must
be a power of two and a multiple of alignment
sizeof(void *)
.
You can free memory allocated by posix_memalign()
using
the standard C library free()
function.
Returns
The returned address is written to the void *
variable
pointed to by
.memptr
The integer return value from the function is zero on success, or an error code on failure.
If no block of memory can be found with the requested size
and alignment, the function returns ENOMEM
and
the value of *
is undefined.memptr