ALIGNED_ALLOC(3C) | Standard C Library Functions | ALIGNED_ALLOC(3C) |
aligned_alloc
—
aligned memory allocation
#include
<stdlib.h>
void *
aligned_alloc
(size_t alignment,
size_t size);
The
aligned_alloc
()
function allocates size bytes aligned on the specified
alignment boundary alignment. The value of
alignment is constrained, it must be a power of two
and it must be greater than or equal to the size of a word on the
platform.
Upon successful completion, the
aligned_alloc
() function returns a pointer to
suitably aligned memory at least size bytes large.
Otherwise, a
NULL
pointer is returned and
errno is
set to indicate the error.
The aligned_alloc
() function will fail
if:
ENOMEM
EAGAIN
EINVAL
March 26, 2016 | OmniOS |