From 05cbbf985fed823a174bf95cc78a7d44f948fdab Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 22 May 2024 15:03:13 -0400 Subject: all: document legacy //go:linkname for modules with ≥500 dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For #67401. Change-Id: I7dd28c3b01a1a647f84929d15412aa43ab0089ee Reviewed-on: https://go-review.googlesource.com/c/go/+/587575 Reviewed-by: Cherry Mui Auto-Submit: Russ Cox LUCI-TryBot-Result: Go LUCI --- src/runtime/atomic_pointer.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/runtime/atomic_pointer.go') 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)) -- cgit v1.3