aligned_alloc()
QNX SDP8.0C Library ReferenceAPIDeveloper
Allocate aligned memory
Synopsis:
#include <malloc.h>
void *aligned_alloc( size_t alignment,
size_t size );
Arguments:
- alignment
- The alignment to use for the block of memory.
This must be a multiple of
sizeof( void *)
. - size
- The size of the block to allocate, in bytes. This must be a multiple of alignment.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
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().
Returns:
A pointer to the allocated memory, or NULL if an error occurred.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |
Page updated: