Hacker News new | ask | show | jobs
by MobiusHorizons 1313 days ago
Why 16 byte aligned? That’s 128 bit, double the word size right? What is the significance of that alignment?
1 comments

long double on x86-64 Linux is 16 bytes big and therefore malloc implementation, or any other allocation routines for that matter, must return ptr aligned to the multiples of the largest primitive type. Interestingly, x86-64 Windows long double is 8 bytes so malloc on Windows returns ptrs aligned to the multiples of 8.