Skip to content

Commit 903f313

Browse files
committed
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 <[email protected]> Run-TryBot: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 413672f commit 903f313

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/mcentral.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ func (c *mcentral) cacheSpan() *mspan {
154154
// See comment for partial unswept spans.
155155
}
156156
sweep.active.end(sl)
157-
if trace.enabled {
158-
traceGCSweepDone()
159-
traceDone = true
160-
}
157+
}
158+
if trace.enabled {
159+
traceGCSweepDone()
160+
traceDone = true
161161
}
162162

163163
// We failed to get a span from the mcentral so get one from mheap.

0 commit comments

Comments
 (0)