[go] internal/runtime/maps: document hashing of stack pointers

0 views
Skip to first unread message

Keith Randall (Gerrit)

unread,
Jun 30, 2026, 5:13:33 PM (20 hours ago) Jun 30
to Keith Randall, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Pratt, golang...@luci-project-accounts.iam.gserviceaccount.com, Arseny Samoylov, golang-co...@googlegroups.com

Keith Randall submitted the change

Change information

Commit message:
internal/runtime/maps: document hashing of stack pointers

CL 776281 makes it a bit clearer that we're doing pointer to uintptr
conversion on pointer keys. That sent me down something of a rabbit
hole trying to figure out how that actually could work, given stack
copies could happen after hashing but before the core map operation.
Turns out it does work, for subtle reasons. Documenting here.
Change-Id: I49158c44254f57ca56c7e1ec23c337d80e46ed6a
Reviewed-by: Arseny Samoylov <samoylo...@gmail.com>
Reviewed-by: Michael Pratt <mpr...@google.com>
Reviewed-by: Keith Randall <k...@google.com>
Files:
  • M src/cmd/compile/internal/escape/assign.go
  • M src/cmd/compile/internal/escape/call.go
  • M src/cmd/compile/internal/escape/expr.go
  • M src/internal/runtime/maps/map.go
Change size: S
Delta: 4 files changed, 25 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I49158c44254f57ca56c7e1ec23c337d80e46ed6a
Gerrit-Change-Number: 779240
Gerrit-PatchSet: 3
Gerrit-Owner: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Arseny Samoylov <samoylo...@gmail.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages