diff options
Diffstat (limited to 'libgo/go/runtime/mem.go')
-rw-r--r-- | libgo/go/runtime/mem.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/runtime/mem.go b/libgo/go/runtime/mem.go index 2fc1892a10b..3f213062910 100644 --- a/libgo/go/runtime/mem.go +++ b/libgo/go/runtime/mem.go @@ -52,7 +52,7 @@ type MemStatsType struct { } } -var Sizeof_C_MStats int // filled in by malloc.goc +var Sizeof_C_MStats uintptr // filled in by malloc.goc func init() { if Sizeof_C_MStats != unsafe.Sizeof(MemStats) { @@ -62,8 +62,13 @@ func init() { } // MemStats holds statistics about the memory system. -// The statistics are only approximate, as they are not interlocked on update. +// The statistics may be out of date, as the information is +// updated lazily from per-thread caches. +// Use UpdateMemStats to bring the statistics up to date. var MemStats MemStatsType +// UpdateMemStats brings MemStats up to date. +func UpdateMemStats() + // GC runs a garbage collection. func GC() |