Skip to content

Go struct 内存对齐 | Go 语言高性能编程 | 极客兔兔 #118

@geektutu

Description

@geektutu

https://geektutu.com/post/hpg-struct-alignment.html

Go 语言/golang 高性能编程,Go 语言进阶教程,Go 语言高性能编程(high performance go)。本文介绍了结构体(struct)占用的内存空间如何计算,为什么要字节对齐/内存对齐,Go 语言中的大小和对齐保证(size and alignment guarantees),字节对齐和安全访问(原子访问)的关系,以及如果利用内存对齐的规律减小 struct 内存占用。

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions