// traceGCSweepStart/Done pair on the P.
mp := acquirem()
- if traceEnabled() {
- traceGCSweepStart()
+ trace := traceAcquire()
+ if trace.ok() {
+ trace.GCSweepStart()
+ traceRelease(trace)
}
arenas := h.sweepArenas
unlock(&h.lock)
}
- if traceEnabled() {
- traceGCSweepDone()
+ trace = traceAcquire()
+ if trace.ok() {
+ trace.GCSweepDone()
+ traceRelease(trace)
}
releasem(mp)
}
n -= uintptr(len(inUse) * 8)
}
sweep.active.end(sl)
- if traceEnabled() {
+ trace := traceAcquire()
+ if trace.ok() {
unlock(&h.lock)
// Account for pages scanned but not reclaimed.
- traceGCSweepSpan((n0 - nFreed) * pageSize)
+ trace.GCSweepSpan((n0 - nFreed) * pageSize)
+ traceRelease(trace)
lock(&h.lock)
}