Gnulib module: aligned_alloc
Portability problems fixed by Gnulib:
sizeof (void *)on some platforms: macOS 11.1, AIX 7.2.
Portability problems not fixed by Gnulib:
aligned_alloccrashes if the requested size is not a multiple of the alignment: AddressSanitizer (gcc 11.2 or clang 13).
Gnulib has partial substitutes for
that do not crash even if the AddressSanitizer bug is present:
alignallocprovides a portable function
alignallocthat is a near-substitute for for glibc
aligned_alloc, except that the result must be freed with
alignfreerather than plain
aligned-mallocprovides functions for allocating and freeing blocks of suitably aligned memory.
pagealign_allocprovides a similar API for allocating and freeing blocks of memory aligned on a system page boundary.