mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-01-23 00:07:22 +00:00
38 lines
2.5 KiB
Plaintext
38 lines
2.5 KiB
Plaintext
var pt image.Point
|
|
|
|
+----------+
|
|
| |
|
|
| stack | +--------------------+ +-------------------+
|
|
| cRED | | cGRE | | cPNK |
|
|
+----------+ | var pt image.Point | -=--------> | unsafe.Sizeof(pt) |
|
|
| cAAA | | | | |
|
|
| unused | +--------------------+ +-------------------+
|
|
| | | |
|
|
+----------+ | |
|
|
| cAAA | | +=-unsafe.Offsetof(pt.Y) |
|
|
| heap | | +=-unsafe.Offsetof(pt.X) |
|
|
| | | | |
|
|
+----------+ | | unsafe.Sizeof(pt.Y) |
|
|
| cBLU | | | unsafe.Sizeof(pt.X) |
|
|
| data | : | | |
|
|
| | v v v |
|
|
+----------+ +-------+--------------+---+------+-----+ |
|
|
| | | | | | | | |
|
|
| pkg·pt.Y | <------=-- | DATA | ·pt+8(SB) | / | 8, | $0 | |
|
|
| cBLU | | cBLU | cYEL | | cRED |cRED | |
|
|
+----------+ +-------+--------------+---+------+-----+ |
|
|
| | | | | | | | |
|
|
| pkg·pt.X | <------=-- | DATA | ·pt+0(SB) | / | 8, | $0 | |
|
|
| cBLU | | cBLU | cYEL | | cRED |cRED | |
|
|
+----------+ <--+ +-------+--------------+---+------+-----+ |
|
|
| cBLU | | |
|
|
| data | +----------------=-+ :
|
|
| | pkg·pt | v
|
|
+----------+ +-------+------+-------+-----------------------+--------+
|
|
| cYEL | | | | | | |
|
|
| text | | GLOBL | ·pt | (SB), | NOPTR, | $16 |
|
|
| | | cBLU | cYEL | cYEL | cPNK | cRED |
|
|
+----------+ <--+ +-------+------+-------+-----------------------+--------+
|
|
| |
|
|
+------------------------=-+SB
|