]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: correct field alignment in machVMRegionBasicInfoData
authorCherry Mui <cherryyz@google.com>
Fri, 4 Aug 2023 20:30:40 +0000 (16:30 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 4 Aug 2023 23:35:39 +0000 (23:35 +0000)
commita0c02df519afdb921288df9e57efcd4a7fdb735a
tree2fac0956c1cca42a9e648e33f83046902a4fcfc8
parenta4b6685c4c94152cdb9cb80061478e20c9fc2e88
runtime/pprof: correct field alignment in machVMRegionBasicInfoData

The type machVMRegionBasicInfoData is generated from C type
vm_region_basic_info_data_64_t, which is a packed struct with a
64-bit field at offset 20. We cannot use uint64 as the field type
in the Go struct, as that will be aligned at offset 24, which does
not match the C struct. Change back to [8]byte (which is what the
cgo command generates), but keep the name Offset.

Updates #61707.
Updates #50891.

Change-Id: I2932328d7f9dfe9d79cff89752666c794d4d3788
Reviewed-on: https://go-review.googlesource.com/c/go/+/516156
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/runtime/pprof/defs_darwin_amd64.go
src/runtime/pprof/defs_darwin_arm64.go
src/runtime/pprof/vminfo_darwin.go