diff options
Diffstat (limited to 'src/pkg/runtime/malloc.go')
| -rw-r--r-- | src/pkg/runtime/malloc.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go index 8ee460755f..578fbd1c2d 100644 --- a/src/pkg/runtime/malloc.go +++ b/src/pkg/runtime/malloc.go @@ -413,6 +413,7 @@ func gogc(force int32) { return } releasem(mp) + mp = nil if panicking != 0 { return @@ -441,7 +442,11 @@ func gogc(force int32) { startTime := gonanotime() mp = acquirem() mp.gcing = 1 + releasem(mp) stoptheworld() + if mp != acquirem() { + gothrow("gogc: rescheduled") + } clearpools() @@ -474,6 +479,7 @@ func gogc(force int32) { semrelease(&worldsema) starttheworld() releasem(mp) + mp = nil // now that gc is done, kick off finalizer thread if needed if !concurrentSweep { |
