syscall: mark C syscall functions noescape
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 16 Jan 2019 22:38:33 +0000 (22:38 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 16 Jan 2019 22:38:33 +0000 (22:38 +0000)
    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

gcc/go/gofrontend/MERGE
libgo/go/syscall/exec_linux.go
libgo/go/syscall/mksyscall.awk

index b13915110b9685135adfcf2d0601e82c4946b05f..67abd997051b49ef9ad2e2ac5713858d8331118a 100644 (file)
@@ -1,4 +1,4 @@
-9a79c333e896ea49f6a708d459148074d29a2af6
+ee94431c133a90ca5c3c5ebbebcb019c60258dac
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 4cc018b496142ab384afc44085e469cb3008f8ae..e5ccc69015583c57294239337bee4de8d78bbe8a 100644 (file)
@@ -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.
index 6fbd2ac8ef32db37e0e10502fae0a6a5d3a9f0c2..50802d9f521f62c07be75be5828f876e724bd2f8 100644 (file)
@@ -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)
     }