public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Mark syscall functions noescape
@ 2019-01-16 22:38 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2019-01-16 22:38 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

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

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1447 bytes --]

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)
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-16 22:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 22:38 libgo patch committed: Mark syscall functions noescape Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).