Commit 9d93d574 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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
parent 8e985dcd
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment