Created
February 13, 2021 14:20
-
-
Save romanitalian/60a3a245178f95e5d9588c9856c5c51b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
type Foo struct { | |
aaa [2]bool | |
bbb int32 | |
ccc [2]bool | |
} | |
type Bar struct { | |
aaa [2]bool | |
ccc [2]bool | |
bbb int64 | |
} | |
fmt.Printf("required alignment: %+v\n", unsafe.Alignof(Foo{})) // required alignment: 4 | |
fmt.Printf("required alignment: %+v\n", unsafe.Alignof(Bar{})) // required alignment: 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment