detached 450319b

purego: revert "use sync.Pool in syscall_syscall15X" (#286)

This reverts commit 05d8da40782673669b51533ccbfedfa71dd8c437, and
add tests to run tests without optimization.
commit
450319b71c523c3716a29e3068ef333583744aea
author
Hajime Hoshi · · 2024-10-18 19:17 UTC
committer
GitHub · · 2024-10-18 19:17 UTC
parent
05d8da4
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
2 files · +13 -4
M .github/workflows/test.yml +11 -0
@@ -93,6 +93,11 @@ jobs:
9393 run: |
9494 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...
9595 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
96+ # Compile without optimization to check potential stack overflow.
97+ # The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
98+ # See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch.
99+ # TODO: CGO_ENABLED=0 might cause SEGV. Fix this issue.
100+ env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
96101
97102 - name: go test (Linux arm64)
98103 if: runner.os == 'Linux'
@@ -209,6 +214,12 @@ jobs:
209214 echo "=> go test CGO_ENABLED=1"
210215 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
211216
217+ echo "=> go test CGO_ENABLED=0 w/o optimization"
218+ env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...
219+
220+ echo "=> go test CGO_ENABLED=1 w/o optimization"
221+ env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
222+
212223 if [ -z "$(echo ${{matrix.go}} | grep '^1.1')" ]; then
213224 echo "=> go test race"
214225 go test -race -shuffle=on -v -count=10 ./...
@@ -93,6 +93,11 @@ jobs:
93 run: |93 run: |
94 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...94 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...
95 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...95 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
96+ # Compile without optimization to check potential stack overflow.
97+ # The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
98+ # See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch.
99+ # TODO: CGO_ENABLED=0 might cause SEGV. Fix this issue.
100+ env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
96 101
97 - name: go test (Linux arm64)102 - name: go test (Linux arm64)
98 if: runner.os == 'Linux'103 if: runner.os == 'Linux'
@@ -209,6 +214,12 @@ jobs:
209 echo "=> go test CGO_ENABLED=1"214 echo "=> go test CGO_ENABLED=1"
210 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...215 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
211 216
217+ echo "=> go test CGO_ENABLED=0 w/o optimization"
218+ env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...
219+
220+ echo "=> go test CGO_ENABLED=1 w/o optimization"
221+ env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
222+
212 if [ -z "$(echo ${{matrix.go}} | grep '^1.1')" ]; then223 if [ -z "$(echo ${{matrix.go}} | grep '^1.1')" ]; then
213 echo "=> go test race"224 echo "=> go test race"
214 go test -race -shuffle=on -v -count=10 ./...225 go test -race -shuffle=on -v -count=10 ./...
M syscall_sysv.go +2 -4
@@ -16,14 +16,12 @@ var syscall15XABI0 uintptr
1616
1717 //go:nosplit
1818 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 := thePool.Get().(*syscall15Args)
20- defer thePool.Put(args)
21- *args = syscall15Args{
19+ args := syscall15Args{
2220 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
2321 a1, a2, a3, a4, a5, a6, a7, a8,
2422 0,
2523 }
26- runtime_cgocall(syscall15XABI0, unsafe.Pointer(args))
24+ runtime_cgocall(syscall15XABI0, unsafe.Pointer(&args))
2725 return args.a1, args.a2, 0
2826 }
2927
@@ -16,14 +16,12 @@ var syscall15XABI0 uintptr
16 16
17 //go:nosplit17 //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) {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) {
19- args := thePool.Get().(*syscall15Args)19+ args := syscall15Args{
20- defer thePool.Put(args)
21- *args = syscall15Args{
22 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,20 fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
23 a1, a2, a3, a4, a5, a6, a7, a8,21 a1, a2, a3, a4, a5, a6, a7, a8,
24 0,22 0,
25 }23 }
26- runtime_cgocall(syscall15XABI0, unsafe.Pointer(args))24+ runtime_cgocall(syscall15XABI0, unsafe.Pointer(&args))
27 return args.a1, args.a2, 025 return args.a1, args.a2, 0
28 }26 }
29 27

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