aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-08-23 17:47:11 -0700
committerIan Lance Taylor <iant@golang.org>2016-08-24 16:57:50 +0000
commit873dca4c17437d07ae97ef4f9e9a8e8c93d88bd7 (patch)
tree89e569d2533c7920581f45b3a1013f6d5a38257d /src/debug
parente69912e6f44b09d8bafde32f11642579272ab4af (diff)
downloadgo-873dca4c17437d07ae97ef4f9e9a8e8c93d88bd7.tar.xz
net: use runtime.Keepalive for *netFD values
The net package sets a finalizer on *netFD. I looked through all the uses of *netFD in the package, looking for each case where a *netFD was passed as an argument and the final reference to the argument was not a function or method call. I added a call to runtime.KeepAlive after each such final reference (there were only three). The code is safe today without the KeepAlive calls because the compiler keeps arguments alive for the duration of the function. However, that is not a language requirement, so adding the KeepAlive calls ensures that this code remains safe even if the compiler changes in the future. Change-Id: I4e2bd7c5a946035dc509ccefb4828f72335a9ee3 Reviewed-on: https://go-review.googlesource.com/27650 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/debug')
0 files changed, 0 insertions, 0 deletions