1
0
mirror of https://github.com/golang/go synced 2024-11-26 11:48:03 -07:00

internal/runtime/maps: fix noswiss builder

Missed initializing a field in the stub that lets the noswiss
builder test the swiss implementation.

Change-Id: Ie093478ad3e4301e4fe88ba65c132a9dbccd89a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/628895
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
khr@golang.org 2024-11-17 13:24:43 -08:00 committed by Gopher Robot
parent d1180dbd5e
commit 90b1dc0192

View File

@ -33,12 +33,13 @@ func newTestMapType[K comparable, V any]() *abi.SwissMapType {
var slot instantiatedSlot[K, V] var slot instantiatedSlot[K, V]
mt := &abi.SwissMapType{ mt := &abi.SwissMapType{
Key: omt.Key, Key: omt.Key,
Elem: omt.Elem, Elem: omt.Elem,
Group: abi.TypeOf(grp), Group: abi.TypeOf(grp),
Hasher: omt.Hasher, Hasher: omt.Hasher,
SlotSize: unsafe.Sizeof(slot), SlotSize: unsafe.Sizeof(slot),
ElemOff: unsafe.Offsetof(slot.elem), GroupSize: unsafe.Sizeof(grp),
ElemOff: unsafe.Offsetof(slot.elem),
} }
if omt.NeedKeyUpdate() { if omt.NeedKeyUpdate() {
mt.Flags |= abi.SwissMapNeedKeyUpdate mt.Flags |= abi.SwissMapNeedKeyUpdate