go.sys/unix: use "use" in syscall interface
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144980043
diff --git a/windows/syscall.go b/windows/syscall.go
index 784a342..281cd66 100644
--- a/windows/syscall.go
+++ b/windows/syscall.go
@@ -21,7 +21,10 @@
// holds a value of type syscall.Errno.
package windows
-import "syscall"
+import (
+ "syscall"
+ "unsafe"
+)
// ByteSliceFromString returns a NUL-terminated slice of bytes
// containing the text of s. If s contains a NUL byte at any
@@ -67,3 +70,8 @@
func (tv *Timeval) Nano() int64 {
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
}
+
+// use is a no-op, but the compiler cannot see that it is.
+// Calling use(p) ensures that p is kept live until that point.
+//go:noescape
+func use(p unsafe.Pointer)