Memory alignment : how to use alignof / alignas?
12:36 13 Jun 2013

I work with shared memory right now.

I can't understand alignof and alignas.

cppreference is unclear : alignof returns "alignment" but what is "alignment" ? number of bytes to add for the next block to be aligned ? padded size ? Stack overflow / blogs entries are unclear too.

Can someone explain clearly alignof and alignas ?

c++ c++11 x86-64 memory-alignment alignas