Skip to content

Commit 786e62b

Browse files
committed
runtime: don't use cgo_unsafe_args for syscall9 wrapper
It uses less stack space this way. Similar to CL 386719 Update #71302 Change-Id: I585bde5f681a90a6900cbd326994ab8a122fd148 Reviewed-on: https://go-review.googlesource.com/c/go/+/665695 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
1 parent 9d7de04 commit 786e62b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/runtime/sys_darwin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ func syscall6()
7070
//
7171
//go:linkname syscall_syscall9 syscall.syscall9
7272
//go:nosplit
73-
//go:cgo_unsafe_args
7473
func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) {
74+
args := struct{ fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, r1, r2, err uintptr }{fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, r1, r2, err}
7575
entersyscall()
76-
libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall9)), unsafe.Pointer(&fn))
76+
libcCall(unsafe.Pointer(abi.FuncPCABI0(syscall9)), unsafe.Pointer(&args))
7777
exitsyscall()
78-
return
78+
return args.r1, args.r2, args.err
7979
}
8080
func syscall9()
8181

0 commit comments

Comments
 (0)