aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-10-27 17:34:11 -0400
committerAustin Clements <austin@google.com>2015-11-05 21:24:01 +0000
commitbbf2da00fcd04746ec486a4361a28c99374b7eb6 (patch)
treebdb42be8755c1073375c426e7d104f22e648a72a /src/runtime/malloc.go
parentc99d7f7f852b525694c645e00b6c06729a6735a2 (diff)
downloadgo-bbf2da00fcd04746ec486a4361a28c99374b7eb6.tar.xz
runtime: remove GC start up/shutdown workaround in mallocgc
Currently mallocgc detects if the GC is in a state where it can't assist, but also can't allocate uncontrolled and yields to help out the GC. This was a workaround for periods when we were trying to schedule the GC coordinator. It is no longer necessary because there is no GC coordinator and malloc can always assist with any GC transitions that are necessary. Updates #11970. Change-Id: I4f7beb7013e85e50ae99a3a8b0bb708ba49cbcd4 Reviewed-on: https://go-review.googlesource.com/16392 Reviewed-by: Rick Hudson <rlh@golang.org> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 81c3bdf5ce..365422a87a 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -736,17 +736,6 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
if shouldhelpgc && gcShouldStart(false) {
gcStart(gcBackgroundMode, false)
- } else if shouldhelpgc && bggc.working != 0 && gcBlackenEnabled == 0 {
- // The GC shutting down, so we can't
- // assist, but we also can't allocate unabated. Slow
- // down this G's allocation and help the GC stay
- // scheduled by yielding.
- //
- // TODO: This is unused. Remove.
- gp := getg()
- if gp != gp.m.g0 && gp.m.locks == 0 && gp.m.preemptoff == "" {
- Gosched()
- }
}
return x