Created
July 4, 2018 10:10
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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