aboutsummaryrefslogtreecommitdiff
path: root/src/internal/runtime/maps/export_test.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2024-08-21 16:17:16 -0400
committerGopher Robot <gobot@golang.org>2024-10-29 18:54:17 +0000
commited035af7b7d7c1cd2e6f852e22a9b04fc2a2cc65 (patch)
tree43fd16f1c843197c59be555e6992324ca7c1f0da /src/internal/runtime/maps/export_test.go
parentcf967172097948a57d2e7cd037db87eaf261ec44 (diff)
downloadgo-ed035af7b7d7c1cd2e6f852e22a9b04fc2a2cc65.tar.xz
internal/runtime/maps: remove type fields
Rather than storing the same type pointer in multiple places, just pass it around. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap Change-Id: Ia6c74805c7a44125ae473177b317f16c6688e6de Reviewed-on: https://go-review.googlesource.com/c/go/+/622377 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/internal/runtime/maps/export_test.go')
-rw-r--r--src/internal/runtime/maps/export_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/internal/runtime/maps/export_test.go b/src/internal/runtime/maps/export_test.go
index 15c112e737..0cc78b954f 100644
--- a/src/internal/runtime/maps/export_test.go
+++ b/src/internal/runtime/maps/export_test.go
@@ -57,7 +57,7 @@ func (m *Map) GroupCount() uint64 {
// Returns nil if there are no full groups.
// Returns nil if a group is full but contains entirely deleted slots.
// Returns nil if the map is small.
-func (m *Map) KeyFromFullGroup() unsafe.Pointer {
+func (m *Map) KeyFromFullGroup(typ *abi.SwissMapType) unsafe.Pointer {
if m.dirLen <= 0 {
return nil
}
@@ -71,7 +71,7 @@ func (m *Map) KeyFromFullGroup() unsafe.Pointer {
lastTab = t
for i := uint64(0); i <= t.groups.lengthMask; i++ {
- g := t.groups.group(i)
+ g := t.groups.group(typ, i)
match := g.ctrls().matchEmpty()
if match != 0 {
continue
@@ -82,7 +82,7 @@ func (m *Map) KeyFromFullGroup() unsafe.Pointer {
if g.ctrls().get(j) == ctrlDeleted {
continue
}
- return g.key(j)
+ return g.key(typ, j)
}
}
}
@@ -91,12 +91,12 @@ func (m *Map) KeyFromFullGroup() unsafe.Pointer {
}
// Returns nil if the map is small.
-func (m *Map) TableFor(key unsafe.Pointer) *table {
+func (m *Map) TableFor(typ *abi.SwissMapType, key unsafe.Pointer) *table {
if m.dirLen <= 0 {
return nil
}
- hash := m.typ.Hasher(key, m.seed)
+ hash := typ.Hasher(key, m.seed)
idx := m.directoryIndex(hash)
return m.directoryAt(idx)
}