]> Cypherpunks repositories - gostls13.git/commit
runtime: add a note on SetFinalizer doc about method receiver
authorAnuraag Agrawal <anuraaga@gmail.com>
Thu, 6 Jun 2024 04:24:26 +0000 (04:24 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 7 Jun 2024 01:56:56 +0000 (01:56 +0000)
commitf7c330eac7777612574d8a1652fd415391f6095e
tree71043151503ee94eb2730889d8da5a809cb6d539
parentcf501e05e138e6911f759a5db786e90b295499b9
runtime: add a note on SetFinalizer doc about method receiver

A method receiver can be collected during the execution of that method.
This does make sense when thinking about how the GC would work, but
also seems not very obvious, so a point in the docs can increase the
chance of avoiding issues caused by missing KeepAlive of method
receivers.

Change-Id: I6817237dd022b5729dbdcda1b9f70c7059605575
GitHub-Last-Rev: 878bf3fde7b4ed66be0302ffdd5e704b4cd70a6c
GitHub-Pull-Request: golang/go#67777
Reviewed-on: https://go-review.googlesource.com/c/go/+/589735
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/runtime/mfinal.go