aligned_alloc
=============

Documentation:
 man aligned_alloc

Gnulib module: aligned_alloc

Portability problems fixed by Gnulib:

  * This function fails if the alignment argument is smaller than sizeof (void *) on some platforms: macOS 11.1, AIX 7.2.

Portability problems not fixed by Gnulib:

  * On some platforms, aligned_alloc crashes if the requested size is not a multiple of the alignment: AddressSanitizer (gcc 11.2 or clang 13).

  * This function is missing on many older platforms: glibc 2.15, macOS 10.13, FreeBSD 6.4, NetBSD 7.1, OpenBSD 6.0, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.

Gnulib has partial substitutes for aligned_alloc that do not crash even if the AddressSanitizer bug is present:

  * The Gnulib module alignalloc provides a portable function alignalloc that is a near-substitute for for glibc aligned_alloc, except that the result must be freed with alignfree rather than plain free.

  * The Gnulib module aligned-malloc provides functions for allocating and freeing blocks of suitably aligned memory.

  * The Gnulib module pagealign_alloc provides a similar API for allocating and freeing blocks of memory aligned on a system page boundary.