detached 6dda16a

purego: use sync.Pool in syscall_syscall15X (#328)

This works around the stack growth issue in 05d8da4 by not marking the function as nosplit.
This commit uses a pool to cache syscall15Args instances. Otherwise a new instance
was allocated on the heap for each purego call.
commit
6dda16a6f8ed36b52fe7ef10ae40e6d1d4dcde7c
author
oliverbestmann · · 2025-07-30 23:52 UTC
committer
GitHub · · 2025-07-30 23:52 UTC
parent
cdb93a8
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
1 file · +6 -3
M syscall_sysv.go +6 -3
@@ -14,14 +14,17 @@ import (
1414
1515 var syscall15XABI0 uintptr
1616
17-//go:nosplit
1817 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
19- args := syscall15Args{
18+ args := thePool.Get().(*syscall15Args)
19+ defer thePool.Put(args)
20+
21+ *args = syscall15Args{
2022 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
2123 a1, a2, a3, a4, a5, a6, a7, a8,
2224 0,
2325 }
24- runtime_cgocall(syscall15XABI0, unsafe.Pointer(&args))
26+
27+ runtime_cgocall(syscall15XABI0, unsafe.Pointer(args))
2528 return args.a1, args.a2, 0
2629 }
2730
@@ -14,14 +14,17 @@ import (
14 14
15 var syscall15XABI0 uintptr15 var syscall15XABI0 uintptr
16 16
17-//go:nosplit
18 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {17 func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) {
19- args := syscall15Args{18+ args := thePool.Get().(*syscall15Args)
19+ defer thePool.Put(args)
20+
21+ *args = syscall15Args{
20 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,22 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
21 a1, a2, a3, a4, a5, a6, a7, a8,23 a1, a2, a3, a4, a5, a6, a7, a8,
22 0,24 0,
23 }25 }
24- runtime_cgocall(syscall15XABI0, unsafe.Pointer(&args))26+
27+ runtime_cgocall(syscall15XABI0, unsafe.Pointer(args))
25 return args.a1, args.a2, 028 return args.a1, args.a2, 0
26 }29 }
27 30

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close