I know that you can align variables with the cache line using, for example, the ((align (64))) attribute in gcc. However, I am interested in alignment (or you could call it filling) at the time the structure is declared. So, for example, for the next structure, I want to ask the compiler to create the necessary padding so that any object of this structure is always aligned with the cache line.
typedef struct
{
int a;
int b;
} my_type;
source
share