From 417a323d1ff573ad2cf2d05a5bdcf1d4385c2ff9 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 9 Sep 2014 11:25:43 -0700 Subject: [PATCH] go.sys/plan9: define "use" in plan9/syscall.go LGTM=0intro R=rsc, 0intro CC=golang-codereviews https://golang.org/cl/141870043 --- plan9/syscall.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plan9/syscall.go b/plan9/syscall.go index 03230010..b9941873 100644 --- a/plan9/syscall.go +++ b/plan9/syscall.go @@ -21,6 +21,8 @@ // holds a value of type syscall.ErrorString. package plan9 +import "unsafe" + // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). @@ -65,3 +67,8 @@ func (ts *Timespec) Nano() int64 { 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)