1
0
mirror of https://github.com/golang/go synced 2024-09-30 04:24:29 -06:00

runtime: fix unclosed GCSweepStart trace event

CL 333389 erroneously moved traceGCSweepDone inside the sl.valid block
that it introduced in mcentral.cacheSpan, when it should have left it
outside that scope, because the trace event is created unconditionally
at the top of the method.

Fixes #49231.

Change-Id: If719c05063d4f4d330a320da6dc00d1e9d8102e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/359775
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Michael Anthony Knyszek 2021-10-29 17:58:42 +00:00 committed by Michael Knyszek
parent 413672fc84
commit 903f313d8b

View File

@ -154,10 +154,10 @@ func (c *mcentral) cacheSpan() *mspan {
// See comment for partial unswept spans. // See comment for partial unswept spans.
} }
sweep.active.end(sl) sweep.active.end(sl)
if trace.enabled { }
traceGCSweepDone() if trace.enabled {
traceDone = true traceGCSweepDone()
} traceDone = true
} }
// We failed to get a span from the mcentral so get one from mheap. // We failed to get a span from the mcentral so get one from mheap.