aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/map.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-21 23:24:47 -0400
committerGopher Robot <gobot@golang.org>2024-05-23 00:18:55 +0000
commitbde905af5b11e3e34bc1f5d4846d7767f7197236 (patch)
tree8def6eab2e681e1b463e8327279bc8f833b5f10f /src/runtime/map.go
parent2f07d4455636ece45ff843fe4d9298ea65f933c1 (diff)
downloadgo-bde905af5b11e3e34bc1f5d4846d7767f7197236.tar.xz
all: document legacy //go:linkname for modules with ≥20,000 dependents
For #67401. Change-Id: Icc10ede72547d8020c0ba45e89d954822a4b2455 Reviewed-on: https://go-review.googlesource.com/c/go/+/587218 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/map.go')
-rw-r--r--src/runtime/map.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/runtime/map.go b/src/runtime/map.go
index d284acf803..a55feb45fb 100644
--- a/src/runtime/map.go
+++ b/src/runtime/map.go
@@ -283,6 +283,16 @@ func makemap64(t *maptype, hint int64, h *hmap) *hmap {
// makemap_small implements Go map creation for make(map[k]v) and
// make(map[k]v, hint) when hint is known to be at most bucketCnt
// at compile time and the map needs to be allocated on the heap.
+//
+// makemap_small should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/bytedance/sonic
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname makemap_small
func makemap_small() *hmap {
h := new(hmap)
h.hash0 = uint32(rand())
@@ -591,6 +601,7 @@ func mapaccess2_fat(t *maptype, h *hmap, key, zero unsafe.Pointer) (unsafe.Point
// mapassign should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
+// - github.com/bytedance/sonic
// - github.com/ugorji/go/codec
//
// Do not remove or change the type signature.
@@ -847,6 +858,7 @@ search:
// mapiterinit should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
+// - github.com/bytedance/sonic
// - github.com/goccy/go-json
// - github.com/ugorji/go/codec
//
@@ -903,6 +915,7 @@ func mapiterinit(t *maptype, h *hmap, it *hiter) {
// mapiternext should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
+// - github.com/bytedance/sonic
// - github.com/ugorji/go/codec
//
// Do not remove or change the type signature.