src/runtime/mheap.go | 5 +++++ diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index bf682ec97f93b4e6b3fae4225c62f51ac7037540..893587e5d2243a0a99f8a131853a500c7d9a5d3f 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -503,6 +503,11 @@ sp := (*slice)(unsafe.Pointer(&h.spans)) sp.array = unsafe.Pointer(spansStart) sp.len = 0 sp.cap = int(spansBytes / sys.PtrSize) + + // Map metadata structures. But don't map race detector memory + // since we're not actually growing the arena here (and TSAN + // gets mad if you map 0 bytes). + h.setArenaUsed(h.arena_used, false) } // setArenaUsed extends the usable arena to address arena_used and