aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-10-29 17:58:42 +0000
committerMichael Knyszek <mknyszek@google.com>2021-10-29 18:34:24 +0000
commit903f313d8b6e85c031fc5918273ff4800fa9f952 (patch)
tree541ba3d9aebbae60891651e0371b8bb053a4c7c6 /src
parent413672fc84e0ced7531cdc7cf0e5db32061e8194 (diff)
downloadgo-903f313d8b6e85c031fc5918273ff4800fa9f952.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/mcentral.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/mcentral.go b/src/runtime/mcentral.go
index 4ae3a883a4..e4bdf35071 100644
--- a/src/runtime/mcentral.go
+++ b/src/runtime/mcentral.go
@@ -154,10 +154,10 @@ func (c *mcentral) cacheSpan() *mspan {
// See comment for partial unswept spans.
}
sweep.active.end(sl)
- if trace.enabled {
- traceGCSweepDone()
- traceDone = true
- }
+ }
+ if trace.enabled {
+ traceGCSweepDone()
+ traceDone = true
}
// We failed to get a span from the mcentral so get one from mheap.