From c39bc22c141bc6990e4e2abf604dcf56669ff779 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 3 May 2024 13:03:04 -0400 Subject: all: wire up swisstable maps Use the new SwissTable-based map in internal/runtime/maps as the basis for the runtime map when GOEXPERIMENT=swissmap. Integration is complete enough to pass all.bash. Notable missing features: * Race integration / concurrent write detection * Stack-allocated maps * Specialized "fast" map variants * Indirect key / elem For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-amd64-longtest-swissmap Change-Id: Ie97b656b6d8e05c0403311ae08fef9f51756a639 Reviewed-on: https://go-review.googlesource.com/c/go/+/594596 Reviewed-by: Keith Randall Reviewed-by: Keith Randall Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI --- src/internal/runtime/maps/table_debug.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/internal/runtime/maps/table_debug.go') diff --git a/src/internal/runtime/maps/table_debug.go b/src/internal/runtime/maps/table_debug.go index 7170fb68fe..b800858e55 100644 --- a/src/internal/runtime/maps/table_debug.go +++ b/src/internal/runtime/maps/table_debug.go @@ -6,7 +6,7 @@ package maps import ( - sabi "internal/runtime/maps/internal/abi" + "internal/abi" "unsafe" ) @@ -24,7 +24,7 @@ func (t *table) checkInvariants() { var empty uint64 for i := uint64(0); i <= t.groups.lengthMask; i++ { g := t.groups.group(i) - for j := uint32(0); j < sabi.SwissMapGroupSlots; j++ { + for j := uint32(0); j < abi.SwissMapGroupSlots; j++ { c := g.ctrls().get(j) switch { case c == ctrlDeleted: @@ -60,7 +60,7 @@ func (t *table) checkInvariants() { panic("invariant failed: found mismatched used slot count") } - growthLeft := (t.capacity*maxAvgGroupLoad)/sabi.SwissMapGroupSlots - t.used - deleted + growthLeft := (t.capacity*maxAvgGroupLoad)/abi.SwissMapGroupSlots - t.used - deleted if growthLeft != t.growthLeft { print("invariant failed: found ", t.growthLeft, " growthLeft, but expected ", growthLeft, "\n") t.Print() @@ -93,7 +93,7 @@ func (t *table) Print() { g := t.groups.group(i) ctrls := g.ctrls() - for j := uint32(0); j < sabi.SwissMapGroupSlots; j++ { + for j := uint32(0); j < abi.SwissMapGroupSlots; j++ { print("\t\t\tslot ", j, "\n") c := ctrls.get(j) -- cgit v1.3