summaryrefslogtreecommitdiff
path: root/test/gc2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-07-22 00:55:01 -0400
committerRuss Cox <rsc@golang.org>2011-07-22 00:55:01 -0400
commitcde83625d8c9c9cf6c0212592b4d330f5985a437 (patch)
tree26fa166c3d8d480cd19e6e0e0dd97fe35fa78478 /test/gc2.go
parent1931df9b7253a22b3be9e760d0c247cf612dd71c (diff)
downloadgo-cde83625d8c9c9cf6c0212592b4d330f5985a437.tar.gz
runtime: add UpdateMemStats, use in tests
Drops mallocrep1.go back to a reasonable amount of time. (154 -> 0.8 seconds on my Mac) Fixes issue 2085. R=golang-dev, dvyukov, r CC=golang-dev http://codereview.appspot.com/4811045
Diffstat (limited to 'test/gc2.go')
-rw-r--r--test/gc2.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/gc2.go b/test/gc2.go
index c5c6cbe4b..c54d807df 100644
--- a/test/gc2.go
+++ b/test/gc2.go
@@ -32,7 +32,8 @@ func main() {
}
}
}
-
+
+ runtime.UpdateMemStats()
obj := runtime.MemStats.HeapObjects - st.HeapObjects
if obj > N/5 {
fmt.Println("too many objects left:", obj)