From: Ian Lance Taylor Date: Fri, 10 Sep 2010 22:54:16 +0000 (-0700) Subject: test: Run garbage collector before testing malloc numbers. X-Git-Tag: weekly.2010-09-15~53 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9d93d57465909d6c7f0f0021d42143cd70a1b4c4;p=gostls13.git test: Run garbage collector before testing malloc numbers. The gccgo library generates some garbage in the init routines because it handles interfaces slightly differently. Since the test sets MemStats.Alloc to 0, the first time the garbage collector runs it goes negative and the test fails. R=rsc, r2 CC=golang-dev https://golang.org/cl/2110044 --- diff --git a/test/mallocrep.go b/test/mallocrep.go index b0e0e8f1a3..762f3754f5 100644 --- a/test/mallocrep.go +++ b/test/mallocrep.go @@ -31,6 +31,7 @@ func bigger() { } func main() { + runtime.GC() // clean up garbage from init runtime.MemProfileRate = 0 // disable profiler runtime.MemStats.Alloc = 0 // ignore stacks flag.Parse()