Выделить память с выравниванием
#include <malloc.h>void * memalign( size_t alignment,size_t size );
void
* ).libc
The memalign() function allocates size bytes aligned on a boundary specified by alignment.
![]() | Because the malloc() implementation uses signed, 32 -bit integers to represent the size internally, you can't allocate more than 2 GB in a single allocation. If the size is greater than 2 GB, memalign() indicates an error of ENOMEM . |
A pointer to the allocated block.
Если возникла ошибка функция возвращает NULL
, код ошибки записывается в errno.
void
* ). ЗОСРВ «Нейтрино»
free(), malloc(), posix_memalign()
Предыдущий раздел: Описание API системной библиотеки