]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make debug.FreeOSMemory call runtime.GC()
authorAustin Clements <austin@google.com>
Fri, 24 Feb 2017 02:55:37 +0000 (21:55 -0500)
committerAustin Clements <austin@google.com>
Fri, 31 Mar 2017 01:15:10 +0000 (01:15 +0000)
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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mheap.go

index 2f6cc358c391914a71f7d4a3ebc03e4a5e2ea208..4a5ba45ec132247fd4aa87fc227ce3ee9b9a7948 100644 (file)
@@ -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) })
 }