Allocate aligned memory
#include <malloc.h> void *memalign( size_t alignment, size_t size );
- The alignment that you want to use for the memory. This must be a multiple of size( void *).
- The amount of memory you want to allocate, in bytes.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The memalign() function allocates size bytes aligned on a boundary specified by alignment.
A pointer to the allocated block, or NULL if an error occurred (errno is set).
- The value of alignment isn't a multiple of size(void *).
- There's insufficient memory available with the requested alignment.
Last modified: 2013-09-30