diff options
| author | Michael Pratt <mpratt@google.com> | 2024-08-07 13:02:43 -0400 |
|---|---|---|
| committer | Michael Pratt <mpratt@google.com> | 2024-10-21 14:16:20 +0000 |
| commit | d94b7a187685942579e7d7dc00bf58448cdafce8 (patch) | |
| tree | e3618c50ab04befc9ed7053605b66f923373a802 /src/internal/runtime/maps/table_debug.go | |
| parent | 4d35dcfa217ea75ec0d344202d771ca8d9b51a8a (diff) | |
| download | go-d94b7a187685942579e7d7dc00bf58448cdafce8.tar.xz | |
cmd/compile,internal/runtime/maps: add extendible hashing
Extendible hashing splits a swisstable map into many swisstables. This
keeps grow operations small.
For #54766.
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-amd64-longtest-swissmap
Change-Id: Id91f34af9e686bf35eb8882ee479956ece89e821
Reviewed-on: https://go-review.googlesource.com/c/go/+/604936
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/internal/runtime/maps/table_debug.go')
| -rw-r--r-- | src/internal/runtime/maps/table_debug.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/internal/runtime/maps/table_debug.go b/src/internal/runtime/maps/table_debug.go index b800858e55..2478b02bab 100644 --- a/src/internal/runtime/maps/table_debug.go +++ b/src/internal/runtime/maps/table_debug.go @@ -19,9 +19,9 @@ func (t *table) checkInvariants() { // For every non-empty slot, verify we can retrieve the key using Get. // Count the number of used and deleted slots. - var used uint64 - var deleted uint64 - var empty uint64 + var used uint16 + var deleted uint16 + var empty uint16 for i := uint64(0); i <= t.groups.lengthMask; i++ { g := t.groups.group(i) for j := uint32(0); j < abi.SwissMapGroupSlots; j++ { @@ -82,6 +82,8 @@ func (t *table) checkInvariants() { func (t *table) Print() { print(`table{ seed: `, t.seed, ` + index: `, t.index, ` + localDepth: `, t.localDepth, ` capacity: `, t.capacity, ` used: `, t.used, ` growthLeft: `, t.growthLeft, ` |
