Last active
November 24, 2020 12:19
-
-
Save LarryLuTW/4b15996c4517f4dcca899694d7c84076 to your computer and use it in GitHub Desktop.
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
type T2 struct { | |
f1 int8 // 1 byte | |
f3 int32 // 4 bytes | |
f2 int64 // 8 bytes | |
} | |
func main() { | |
t2 := T2{} | |
fmt.Println(unsafe.Sizeof(t2)) // 16 bytes | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment