aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/pinner.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/pinner.go')
-rw-r--r--src/runtime/pinner.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/pinner.go b/src/runtime/pinner.go
index 0cc48e2164..ea5b909aea 100644
--- a/src/runtime/pinner.go
+++ b/src/runtime/pinner.go
@@ -17,14 +17,14 @@ type Pinner struct {
}
// Pin pins a Go object, preventing it from being moved or freed by the garbage
-// collector until the Unpin method has been called.
+// collector until the [Pinner.Unpin] method has been called.
//
// A pointer to a pinned object can be directly stored in C memory or can be
// contained in Go memory passed to C functions. If the pinned object itself
// contains pointers to Go 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.
+// The argument must be a pointer of any type or an [unsafe.Pointer].
// It's safe to call Pin on non-Go pointers, in which case Pin will do nothing.
func (p *Pinner) Pin(pointer any) {
if p.pinner == nil {
@@ -61,7 +61,7 @@ func (p *Pinner) Pin(pointer any) {
}
}
-// Unpin unpins all pinned objects of the Pinner.
+// Unpin unpins all pinned objects of the [Pinner].
func (p *Pinner) Unpin() {
p.pinner.unpin()