From: Austin Clements Date: Fri, 24 Feb 2017 02:55:37 +0000 (-0500) Subject: runtime: make debug.FreeOSMemory call runtime.GC() X-Git-Tag: go1.9beta1~885 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=786eb5b754780d649f5d85481096d268728d383f;p=gostls13.git runtime: make debug.FreeOSMemory call runtime.GC() Currently freeOSMemory calls gcStart directly, but we really just want it to behave like runtime.GC() and then perform a scavenge, so make it call runtime.GC() rather than gcStart. For #18216. Change-Id: I548ec007afc788e87d383532a443a10d92105937 Reviewed-on: https://go-review.googlesource.com/37518 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 2f6cc358c3..4a5ba45ec1 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -1062,7 +1062,7 @@ func (h *mheap) scavenge(k int32, now, limit uint64) { //go:linkname runtime_debug_freeOSMemory runtime/debug.freeOSMemory func runtime_debug_freeOSMemory() { - gcStart(gcForceBlockMode, gcTrigger{kind: gcTriggerAlways}) + GC() systemstack(func() { mheap_.scavenge(-1, ^uint64(0), 0) }) }