summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test/test/mallocrep.go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-16 15:47:21 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-16 15:47:21 +0000
commit49b4e44b7d540fa846d353b10237848a67789cbf (patch)
treeea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /gcc/testsuite/go.test/test/mallocrep.go
parent82ceb8f6a88a0193971f53e0571e017f2764f7d7 (diff)
downloadgcc-49b4e44b7d540fa846d353b10237848a67789cbf.tar.gz
Update Go library to r60.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/go.test/test/mallocrep.go')
-rw-r--r--gcc/testsuite/go.test/test/mallocrep.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/testsuite/go.test/test/mallocrep.go b/gcc/testsuite/go.test/test/mallocrep.go
index 762f3754f5f..9f47e52e2b6 100644
--- a/gcc/testsuite/go.test/test/mallocrep.go
+++ b/gcc/testsuite/go.test/test/mallocrep.go
@@ -18,6 +18,7 @@ var chatty = flag.Bool("v", false, "chatty")
var oldsys uint64
func bigger() {
+ runtime.UpdateMemStats()
if st := runtime.MemStats; oldsys < st.Sys {
oldsys = st.Sys
if *chatty {
@@ -31,7 +32,7 @@ func bigger() {
}
func main() {
- runtime.GC() // clean up garbage from init
+ runtime.GC() // clean up garbage from init
runtime.MemProfileRate = 0 // disable profiler
runtime.MemStats.Alloc = 0 // ignore stacks
flag.Parse()
@@ -45,8 +46,10 @@ func main() {
panic("fail")
}
b := runtime.Alloc(uintptr(j))
+ runtime.UpdateMemStats()
during := runtime.MemStats.Alloc
runtime.Free(b)
+ runtime.UpdateMemStats()
if a := runtime.MemStats.Alloc; a != 0 {
println("allocated ", j, ": wrong stats: during=", during, " after=", a, " (want 0)")
panic("fail")