diff mbox series

libgo patch committed: Mark syscall functions noescape

Message ID CAOyqgcUbAHCia92tHjcfgsho8+GKAnCCU-va4o21RWHx3SWZ7w@mail.gmail.com
State New
Headers show
Series libgo patch committed: Mark syscall functions noescape | expand

Commit Message

Ian Lance Taylor Jan. 16, 2019, 10:38 p.m. UTC
This patch by Cherry Zhang marks the syscall functions that call into
C code as noescape, so that calling syscall functions that take
pointers do not require allocation.  Bootstrapped and ran Go testsuite
on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
diff mbox series

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 267956)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -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: libgo/go/syscall/exec_linux.go
===================================================================
--- libgo/go/syscall/exec_linux.go	(revision 267941)
+++ libgo/go/syscall/exec_linux.go	(working copy)
@@ -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: libgo/go/syscall/mksyscall.awk
===================================================================
--- libgo/go/syscall/mksyscall.awk	(revision 267941)
+++ libgo/go/syscall/mksyscall.awk	(working copy)
@@ -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)
     }