On 16/09/16 09:04 +0200, Rainer Orth wrote: >Hi Jason, > >> OK, one more: > >this works just fine on both sparc-sun-solaris2.12 and >i386-pc-solaris2.12. > >Once Jonathan's patch to heed aligned_alloc's requirement on size being >a multiple of alignment is in, all is fine on Solaris. I've got a slightly different fix now. We only need to make the size a multiple of alignment for aligned_alloc, however for posix_memalign we need to ensure the alignment is a multiple of sizeof(void*). I'm testing this now (but only on x86_64 GNU/Linux where it wasn't failing anyway). Would using __builtin_expect (sz == 0, false) make sense? Surely it's rare to try to allocate zero bytes.