]> Cypherpunks repositories - gostls13.git/commitdiff
internal/runtime/maps: fix noswiss builder
authorkhr@golang.org <khr@golang.org>
Sun, 17 Nov 2024 21:24:43 +0000 (13:24 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 18 Nov 2024 02:09:01 +0000 (02:09 +0000)
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>

src/internal/runtime/maps/export_noswiss_test.go

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