Memory Alignment in Go
Go မှာ Memory Alignment ဘယ်လို အလုပ်လုပ်သလဲ?
type MyStruct struct {
a int8 // 1 byte ယူတယ်
// ဒီနေရာမှာ 7 bytes padding ဝင်သွားမယ်
b int64 // 8 bytes ယူတယ် (သူ့ကို 8-byte boundary မှာ ရှိစေချင်လို့)
c int32 // 4 bytes ယူတယ်
// ဒီနောက်မှာ 4 bytes padding ထပ်ဝင်မယ်
}Last updated