From 3cf84263ec2648ea88f8d4e3570cb19403a241af Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Wed, 29 Apr 2026 15:24:01 +0000 Subject: [PATCH] runtime: prune tombstones before rehash in fast32 pointer-key insert Change-Id: I08ade4ff3622007cf9e0e3b7a3cd0b9ad1e462ed GitHub-Last-Rev: abf4ca52b327bdcb1ebae1157a039ebd01b36878 GitHub-Pull-Request: golang/go#79030 Reviewed-on: https://go-review.googlesource.com/c/go/+/772060 Reviewed-by: Keith Randall Reviewed-by: Keith Randall Auto-Submit: Keith Randall Reviewed-by: Cherry Mui LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com --- src/internal/runtime/maps/runtime_fast32.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/internal/runtime/maps/runtime_fast32.go b/src/internal/runtime/maps/runtime_fast32.go index c756314897..615c739423 100644 --- a/src/internal/runtime/maps/runtime_fast32.go +++ b/src/internal/runtime/maps/runtime_fast32.go @@ -397,6 +397,10 @@ outer: t.growthLeft++ // will be decremented below to become a no-op. } + if t.growthLeft == 0 { + t.pruneTombstones(typ, m) + } + // If there is room left to grow, just insert the new entry. if t.growthLeft > 0 { slotKey := g.key(typ, i)