diff options
| author | Russ Cox <rsc@golang.org> | 2024-05-21 23:02:51 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-05-22 21:17:41 +0000 |
| commit | 5fee159bc2e60736ce967560ee5be738fe5d5bd2 (patch) | |
| tree | e6ebbad97d446072a6d06b3c5f8a5748b7014b96 /src/runtime/slice.go | |
| parent | 4c589d93ad6f77e31cccc237c20133f0d8d8492f (diff) | |
| download | go-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/slice.go')
| -rw-r--r-- | src/runtime/slice.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/slice.go b/src/runtime/slice.go index 4fbe056b78..3439a0d751 100644 --- a/src/runtime/slice.go +++ b/src/runtime/slice.go @@ -152,6 +152,16 @@ func makeslice64(et *_type, len64, cap64 int64) unsafe.Pointer { // new length so that the old length is not live (does not need to be // spilled/restored) and the new length is returned (also does not need // to be spilled/restored). +// +// growslice 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 growslice func growslice(oldPtr unsafe.Pointer, newLen, oldCap, num int, et *_type) slice { oldLen := newLen - num if raceenabled { |
