Commit a6804ea9 by Ian Lance Taylor

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
parent 07e1534f
9a79c333e896ea49f6a708d459148074d29a2af6 ee94431c133a90ca5c3c5ebbebcb019c60258dac
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -62,6 +62,7 @@ func runtime_AfterFork() ...@@ -62,6 +62,7 @@ func runtime_AfterFork()
func runtime_AfterForkInChild() func runtime_AfterForkInChild()
// Implemented in clone_linux.c // 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 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. // Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
......
...@@ -98,6 +98,7 @@ BEGIN { ...@@ -98,6 +98,7 @@ BEGIN {
printf("// Automatically generated wrapper for %s/%s\n", gofnname, cfnname) printf("// Automatically generated wrapper for %s/%s\n", gofnname, cfnname)
if (!(cfnname in cfns)) { if (!(cfnname in cfns)) {
cfns[cfnname] = 1 cfns[cfnname] = 1
printf("//go:noescape\n")
printf("//extern %s\n", cfnname) printf("//extern %s\n", cfnname)
printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult) printf("func c_%s(%s) %s\n", cfnname, cfnparams, cfnresult)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment