aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-01-16 22:38:33 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-01-16 22:38:33 +0000
commita6804ea9293fc10c85568c475ecdb402106fce8c (patch)
tree1a1cf662c1c95e2cf4823bb2d6923c78490ecf9d /libgo
parent07e1534f44b26a1acb0b3393aae7d1a4a90fa942 (diff)
downloadgcc-a6804ea9293fc10c85568c475ecdb402106fce8c.zip
gcc-a6804ea9293fc10c85568c475ecdb402106fce8c.tar.gz
gcc-a6804ea9293fc10c85568c475ecdb402106fce8c.tar.bz2
syscall: mark C syscall functions noescape
Many C syscall functions take pointer arguments. The pointers don't escape in the C functions. Mark the C functions noescape so calling them doesn't need allocation. Reviewed-on: https://go-review.googlesource.com/c/158158 From-SVN: r267989
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/syscall/exec_linux.go1
-rw-r--r--libgo/go/syscall/mksyscall.awk1
2 files changed, 2 insertions, 0 deletions
diff --git a/libgo/go/syscall/exec_linux.go b/libgo/go/syscall/exec_linux.go
index 4cc018b..e5ccc69 100644
--- a/libgo/go/syscall/exec_linux.go
+++ b/libgo/go/syscall/exec_linux.go
@@ -62,6 +62,7 @@ func runtime_AfterFork()
func runtime_AfterForkInChild()
// Implemented in clone_linux.c
+//go:noescape
func rawClone(flags _C_ulong, child_stack *byte, ptid *Pid_t, ctid *Pid_t, regs unsafe.Pointer) _C_long
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
diff --git a/libgo/go/syscall/mksyscall.awk b/libgo/go/syscall/mksyscall.awk
index 6fbd2ac..50802d9 100644
--- a/libgo/go/syscall/mksyscall.awk
+++ b/libgo/go/syscall/mksyscall.awk
@@ -98,6 +98,7 @@ BEGIN {
printf("// Automatically generated wrapper for %s/%s\n", gofnname, cfnname)
if (!(cfnname in cfns)) {
cfns[cfnname] = 1
+ printf("//go:noescape\n")
printf("//extern %s\n", cfnname)
printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult)
}