aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/runtime/trace2map.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/trace2map.go b/src/runtime/trace2map.go
index 4a5a7ecba4..195ec0bbe7 100644
--- a/src/runtime/trace2map.go
+++ b/src/runtime/trace2map.go
@@ -141,5 +141,11 @@ func (tab *traceMap) reset() {
assertLockHeld(&tab.lock)
tab.mem.drop()
tab.seq.Store(0)
- tab.tab = [1 << 13]atomic.UnsafePointer{}
+ // Clear table without write barriers. The table consists entirely
+ // of notinheap pointers, so this is fine.
+ //
+ // Write barriers may theoretically call into the tracer and acquire
+ // the lock again, and this lock ordering is expressed in the static
+ // lock ranking checker.
+ memclrNoHeapPointers(unsafe.Pointer(&tab.tab), unsafe.Sizeof(tab.tab))
}