aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-08-23 15:56:43 -0700
committerIan Lance Taylor <iant@golang.org>2016-08-24 16:57:09 +0000
commite69912e6f44b09d8bafde32f11642579272ab4af (patch)
tree250a6b4eba7683a39b9e3ce9d5b3b4194c2e31f9 /src/debug
parent9be2a279ee12d0e17646c0b0b12d8dff9b157a59 (diff)
downloadgo-e69912e6f44b09d8bafde32f11642579272ab4af.tar.xz
os: use runtime.Keepalive for *Process values
The os package sets a finalizer on *Process. I looked through all the uses of *Process in the package, looking for each case where a *Process 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. I also removed an existing unnecessry call to runtime.KeepAlive. The syscall.Syscall function is handled specially by the compiler to keep its arguments alive. Change-Id: Ibd2ff20b31ed3de4f6a59dd1633c1b44001d91d9 Reviewed-on: https://go-review.googlesource.com/27637 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