Allocate aligned memory
#include <malloc.h>
void *aligned_alloc( size_t alignment,
size_t size );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The aligned_alloc() function allocates a block of memory of the given size, and aligned on a boundary specified by the given aligment. It's similar to memalign().
A pointer to the allocated memory, or NULL if an error occurred.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |