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