aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/atomic_pointer.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-22 15:03:13 -0400
committerGopher Robot <gobot@golang.org>2024-05-23 01:16:53 +0000
commit05cbbf985fed823a174bf95cc78a7d44f948fdab (patch)
treeffdb52c7ce57360323e22a68e20f45d10771a004 /src/runtime/atomic_pointer.go
parent1d3d6ae725697c5b224b26cb3aa1325ac37f72d7 (diff)
downloadgo-05cbbf985fed823a174bf95cc78a7d44f948fdab.tar.xz
all: document legacy //go:linkname for modules with ≥500 dependents
For #67401. Change-Id: I7dd28c3b01a1a647f84929d15412aa43ab0089ee Reviewed-on: https://go-review.googlesource.com/c/go/+/587575 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Russ Cox <rsc@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/atomic_pointer.go')
-rw-r--r--src/runtime/atomic_pointer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/atomic_pointer.go b/src/runtime/atomic_pointer.go
index e3d17b5cf8..9711fb208b 100644
--- a/src/runtime/atomic_pointer.go
+++ b/src/runtime/atomic_pointer.go
@@ -18,6 +18,15 @@ import (
// atomicwb performs a write barrier before an atomic pointer write.
// The caller should guard the call with "if writeBarrier.enabled".
//
+// atomicwb should be an internal detail,
+// but widely used packages access it using linkname.
+// Notable members of the hall of shame include:
+// - github.com/bytedance/gopkg
+//
+// Do not remove or change the type signature.
+// See go.dev/issue/67401.
+//
+//go:linkname atomicwb
//go:nosplit
func atomicwb(ptr *unsafe.Pointer, new unsafe.Pointer) {
slot := (*uintptr)(unsafe.Pointer(ptr))