From 9d93d57465909d6c7f0f0021d42143cd70a1b4c4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 10 Sep 2010 15:54:16 -0700 Subject: [PATCH] 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 --- test/mallocrep.go | 1 + 1 file changed, 1 insertion(+) 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()