Harry Sintonen <[email protected]> writes: > pagealign code (lib/pagealign_alloc.c) has a mistake whereas USE_MMAP > code uses the linked list to maintain the memory allocations. This is > unnessary as mmap() always returns memory aligned to the page size. > Thus the buffer could be passed as-is, similar to what > HAVE_POSIX_MEMALIGN code is doing.
It is true that Linux returns a page-aligned address, but it isn't required by POSIX [1]. Collin [1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/mmap.html
