diff options
| author | Russ Cox <rsc@golang.org> | 2024-05-21 22:38:02 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-05-22 20:12:46 +0000 |
| commit | ef225d1c57a97af984af114ee52005314530bbe2 (patch) | |
| tree | 745ef06d093490ff1c486249904cc189d1eabf34 /src/runtime/runtime1.go | |
| parent | dca577d882f989e41a753537e9607f0c22e4a798 (diff) | |
| download | go-ef225d1c57a97af984af114ee52005314530bbe2.tar.xz | |
all: document legacy //go:linkname for modules with ≥100,000 dependents
For #67401.
Change-Id: I51f5b561ee11eb242e3b1585d591281d0df4fc24
Reviewed-on: https://go-review.googlesource.com/c/go/+/587215
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/runtime1.go')
| -rw-r--r-- | src/runtime/runtime1.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index 33a1aa5a02..1a6f0366c4 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -614,6 +614,14 @@ func releasem(mp *m) { } } +// reflect_typelinks is meant for package reflect, +// but widely used packages access it using linkname. +// Notable members of the hall of shame include: +// - github.com/modern-go/reflect2 +// +// Do not remove or change the type signature. +// See go.dev/issue/67401. +// //go:linkname reflect_typelinks reflect.typelinks func reflect_typelinks() ([]unsafe.Pointer, [][]int32) { modules := activeModules() @@ -635,6 +643,14 @@ func reflect_resolveNameOff(ptrInModule unsafe.Pointer, off int32) unsafe.Pointe // reflect_resolveTypeOff resolves an *rtype offset from a base type. // +// reflect_resolveTypeOff is meant for package reflect, +// but widely used packages access it using linkname. +// Notable members of the hall of shame include: +// - github.com/modern-go/reflect2 +// +// Do not remove or change the type signature. +// See go.dev/issue/67401. +// //go:linkname reflect_resolveTypeOff reflect.resolveTypeOff func reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { return unsafe.Pointer(toRType((*_type)(rtype)).typeOff(typeOff(off))) |
