We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00c975c commit 88cb912Copy full SHA for 88cb912
internal/examples/basic/structs/struct_memory_padding.go
@@ -8,6 +8,11 @@ import (
8
)
9
10
// MemoryPadding は、構造体メンバーの定義順によってGoランタイムがメモリ上にパディングを挿入することを確認するサンプルです.
11
+//
12
+// REFERENCES:
13
+// - https://itnext.io/structure-size-optimization-in-golang-alignment-padding-more-effective-memory-layout-linters-fffdcba27c61
14
+// - https://logicalbeat.jp/blog/4032/
15
+// - https://ja.wikipedia.org/wiki/%E3%83%87%E3%83%BC%E3%82%BF%E6%A7%8B%E9%80%A0%E3%82%A2%E3%83%A9%E3%82%A4%E3%83%A1%E3%83%B3%E3%83%88
16
func MemoryPadding() error {
17
var (
18
st4bytes = types.Struct4Bytes{} // メモリ上のサイズが 4bytes になる構造体
0 commit comments