← 返回卡片

原书出处

Go 语言高性能编程

12 Go struct 内存对齐

核验版本的摘录快照 · 导入于 2026-10-25T19:55:30.781Z

当 struct{} 作为其他 struct 最后一个字段时,需要填充额外的内存保证安全。我们做个试验,验证下这种情况。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 type demo3 struct { c int32 a struct{} } type

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Go 语言高性能编程/_epub-src/OEBPS/Text/12.html

EPUB SHA-256:865057eb3da7c4612e68f146cf9ea0072d2926325dc9d30c623e51f6b2398f12