mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
gc: align structs according to max alignment of fields
cc: same runtime: test cc alignment (required moving #define of offsetof to runtime.h) fix bug260 Fixes #482. Fixes #609. R=ken2, r CC=golang-dev https://golang.org/cl/3563042
This commit is contained in:
parent
287e45e241
commit
dc9a3b2791
22 changed files with 148 additions and 91 deletions
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
package runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// Breakpoint() executes a breakpoint trap.
|
||||
func Breakpoint()
|
||||
|
||||
|
|
@ -73,6 +75,15 @@ type MemStatsType struct {
|
|||
}
|
||||
}
|
||||
|
||||
var sizeof_C_MStats int // filled in by malloc.goc
|
||||
|
||||
func init() {
|
||||
if sizeof_C_MStats != unsafe.Sizeof(MemStats) {
|
||||
println(sizeof_C_MStats, unsafe.Sizeof(MemStats))
|
||||
panic("MStats vs MemStatsType size mismatch")
|
||||
}
|
||||
}
|
||||
|
||||
// MemStats holds statistics about the memory system.
|
||||
// The statistics are only approximate, as they are not interlocked on update.
|
||||
var MemStats MemStatsType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue