diff options
| author | Michael Pratt <mpratt@google.com> | 2024-09-17 16:30:04 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-10-30 15:05:37 +0000 |
| commit | 2220fd36368c96da3dd833bdc2bbd13be291216a (patch) | |
| tree | b4357eca1856c000e571d1eb5f9dec54d4258344 /src/cmd/compile/internal/reflectdata | |
| parent | 3a6795554daf96d4e01ab02f999a1ea7dde2660c (diff) | |
| download | go-2220fd36368c96da3dd833bdc2bbd13be291216a.tar.xz | |
runtime: add concurrent write checks to swissmap
This is the same design as existing maps.
For #54766.
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap
Change-Id: I5f6ef5fea1e0f0616bcd90eaae7faee4cdac58c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/616460
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata')
| -rw-r--r-- | src/cmd/compile/internal/reflectdata/map_swiss.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/reflectdata/map_swiss.go b/src/cmd/compile/internal/reflectdata/map_swiss.go index 2b79b22235..b531d785d3 100644 --- a/src/cmd/compile/internal/reflectdata/map_swiss.go +++ b/src/cmd/compile/internal/reflectdata/map_swiss.go @@ -144,6 +144,8 @@ func SwissMapType() *types.Type { // // globalDepth uint8 // globalShift uint8 + // + // writing uint8 // // N.B Padding // // clearSeq uint64 @@ -156,6 +158,7 @@ func SwissMapType() *types.Type { makefield("dirLen", types.Types[types.TINT]), makefield("globalDepth", types.Types[types.TUINT8]), makefield("globalShift", types.Types[types.TUINT8]), + makefield("writing", types.Types[types.TUINT8]), makefield("clearSeq", types.Types[types.TUINT64]), } @@ -169,7 +172,7 @@ func SwissMapType() *types.Type { // The size of Map should be 48 bytes on 64 bit // and 32 bytes on 32 bit platforms. - if size := int64(2*8 + 4*types.PtrSize /* one extra for globalDepth + padding */); m.Size() != size { + if size := int64(2*8 + 4*types.PtrSize /* one extra for globalDepth/globalShift/writing + padding */); m.Size() != size { base.Fatalf("internal/runtime/maps.Map size not correct: got %d, want %d", m.Size(), size) } |
