1
0
mirror of https://github.com/golang/go synced 2024-09-25 11:20:13 -06:00

runtime/debug: make TestFreeOSMemory repeatable

Fixes #4835.

R=golang-dev, fullung
CC=golang-dev
https://golang.org/cl/7319050
This commit is contained in:
Dmitriy Vyukov 2013-02-18 15:46:36 +04:00
parent 8ecc4cb41e
commit d62239b5f6

View File

@ -71,11 +71,12 @@ func TestReadGCStats(t *testing.T) {
}
}
var big = make([]byte, 1<<20)
var big []byte
func TestFreeOSMemory(t *testing.T) {
var ms1, ms2 runtime.MemStats
big = make([]byte, 1<<20)
big = nil
runtime.GC()
runtime.ReadMemStats(&ms1)