Skip to content

Instantly share code, notes, and snippets.

@thongntit
Created July 4, 2018 10:10
Show Gist options
  • Save thongntit/9e38884633160874e05d85aeb161ea25 to your computer and use it in GitHub Desktop.
Save thongntit/9e38884633160874e05d85aeb161ea25 to your computer and use it in GitHub Desktop.
Data alignment - Padding Article khá hay và đầy đủ về data alignment và padding https://www.cppdeveloper.com/2018/01/28/data-alignment-trong-c-c/
/* For Windows */
__declspec(align(32)) struct s
{
char a;
int b;
};
/* For Unix-like */
alignas(32) struct s1
{
char a1;
int b1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment