LINUX.ORG.RU

История изменений

Исправление xaizek, (текущая версия) :

man posix_memalign:

NOTES

On  many  systems  there  are  alignment restrictions, for example, on
buffers used for direct block device I/O.  POSIX specifies the
pathconf(path,_PC_REC_XFER_ALIGN) call that tells what alignment is
needed.  Now one can use posix_memalign() to satisfy this requirement.

C99:

7.20.3 Memory management functions

1
The order and contiguity of storage allocated by successive calls to the calloc,
malloc, and realloc functions is unspecified. The pointer returned if the allocation
succeeds is suitably aligned so that it may be assigned to a pointer to any type of object
and then used to access such an object or an array of such objects in the space allocated
(until the space is explicitly deallocated). [...]

Вывод: не нужен тебе posix_memalign().

Исходная версия xaizek, :

man posix_memalign():

NOTES

On  many  systems  there  are  alignment restrictions, for example, on
buffers used for direct block device I/O.  POSIX specifies the
pathconf(path,_PC_REC_XFER_ALIGN) call that tells what alignment is
needed.  Now one can use posix_memalign() to satisfy this requirement.

C99:

7.20.3 Memory management functions

1
The order and contiguity of storage allocated by successive calls to the calloc,
malloc, and realloc functions is unspecified. The pointer returned if the allocation
succeeds is suitably aligned so that it may be assigned to a pointer to any type of object
and then used to access such an object or an array of such objects in the space allocated
(until the space is explicitly deallocated). [...]

Вывод: не нужен тебе posix_memalign().