aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/map_faststr.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-21 23:02:51 -0400
committerGopher Robot <gobot@golang.org>2024-05-22 21:17:41 +0000
commit5fee159bc2e60736ce967560ee5be738fe5d5bd2 (patch)
treee6ebbad97d446072a6d06b3c5f8a5748b7014b96 /src/runtime/map_faststr.go
parent4c589d93ad6f77e31cccc237c20133f0d8d8492f (diff)
downloadgo-5fee159bc2e60736ce967560ee5be738fe5d5bd2.tar.xz
all: document legacy //go:linkname for modules with ≥50,000 dependents
Note that this depends on the revert of CL 581395 to move zeroVal back. For #67401. Change-Id: I507c27c2404ad1348aabf1ffa3740e6b1957495b Reviewed-on: https://go-review.googlesource.com/c/go/+/587217 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/map_faststr.go')
-rw-r--r--src/runtime/map_faststr.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/runtime/map_faststr.go b/src/runtime/map_faststr.go
index d989190f71..bef5d7f95a 100644
--- a/src/runtime/map_faststr.go
+++ b/src/runtime/map_faststr.go
@@ -105,6 +105,15 @@ dohash:
return unsafe.Pointer(&zeroVal[0])
}
+// mapaccess2_faststr should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ugorji/go/codec
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname mapaccess2_faststr
func mapaccess2_faststr(t *maptype, h *hmap, ky string) (unsafe.Pointer, bool) {
if raceenabled && h != nil {
callerpc := getcallerpc()
@@ -200,6 +209,15 @@ dohash:
return unsafe.Pointer(&zeroVal[0]), false
}
+// mapassign_faststr should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/ugorji/go/codec
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname mapassign_faststr
func mapassign_faststr(t *maptype, h *hmap, s string) unsafe.Pointer {
if h == nil {
panic(plainError("assignment to entry in nil map"))