aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2024-01-26 00:47:06 +0000
committerGopher Robot <gobot@golang.org>2024-01-31 21:20:32 +0000
commit916e6cddf1fb0dcbd857ce0fc2deb3531f6fd14a (patch)
treed701190307b550a6800e3ca0b6e1dd0b13634684
parent6552f3d4ac1bd6f6b7240a3568d8075e4c0d49f8 (diff)
downloadgo-916e6cddf1fb0dcbd857ce0fc2deb3531f6fd14a.tar.gz
go-916e6cddf1fb0dcbd857ce0fc2deb3531f6fd14a.zip
[release-branch.go1.21] runtime: fix Pinner.Pin documentation
Fixes #63768 Change-Id: I01a9bb8f9af22a6b3f6534d431e3ea623875ed48 GitHub-Last-Rev: 7c5dd4edb1697b5ffa489e4457c93cdb7d6fa1a8 GitHub-Pull-Request: golang/go#64920 Reviewed-on: https://go-review.googlesource.com/c/go/+/553395 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org>
-rw-r--r--src/runtime/pinner.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/runtime/pinner.go b/src/runtime/pinner.go
index 8bb351eb8f2..75de8be02aa 100644
--- a/src/runtime/pinner.go
+++ b/src/runtime/pinner.go
@@ -25,10 +25,7 @@ type Pinner struct {
// objects, these objects must be pinned separately if they are going to be
// accessed from C code.
//
-// The argument must be a pointer of any type or an
-// unsafe.Pointer. It must be the result of calling new,
-// taking the address of a composite literal, or taking the address of a
-// local variable. If one of these conditions is not met, Pin will panic.
+// The argument must be a pointer of any type or an unsafe.Pointer.
func (p *Pinner) Pin(pointer any) {
if p.pinner == nil {
// Check the pinner cache first.