diff options
Diffstat (limited to 'src/pkg/runtime/debug.go')
| -rw-r--r-- | src/pkg/runtime/debug.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pkg/runtime/debug.go b/src/pkg/runtime/debug.go index 3cc5472f6b..3ce35cc5ba 100644 --- a/src/pkg/runtime/debug.go +++ b/src/pkg/runtime/debug.go @@ -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 |
