aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/syscall_windows_test.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2024-10-08 18:10:17 +0200
committerQuim Muntal <quimmuntal@gmail.com>2024-10-11 17:16:18 +0000
commitfa7343aca326aad061ab877c1a4cebb96c4355c1 (patch)
treeece114b08928a6bf94113907fb676e1fc6ffef1d /src/runtime/syscall_windows_test.go
parent1041c2cf019188954a4c2621f44270505968c291 (diff)
downloadgo-fa7343aca326aad061ab877c1a4cebb96c4355c1.tar.xz
runtime: reduce syscall.SyscallX stack usage
syscall.SyscallX consumes a lot of stack space, which is a problem because they are nosplit functions. They used to use less stack space, but CL 563315, that landed in Go 1.23, increased the stack usage by a lot. This CL reduces the stack usage back to the previous level. Fixes #69813. Change-Id: Iddedd28b693c66a258da687389768055c493fc2e Reviewed-on: https://go-review.googlesource.com/c/go/+/618497 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/syscall_windows_test.go')
-rw-r--r--src/runtime/syscall_windows_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go
index 9ee06a7712..edbc453ec8 100644
--- a/src/runtime/syscall_windows_test.go
+++ b/src/runtime/syscall_windows_test.go
@@ -1206,6 +1206,13 @@ func TestBigStackCallbackSyscall(t *testing.T) {
}
}
+func TestSyscallStackUsage(t *testing.T) {
+ // Test that the stack usage of a syscall doesn't exceed the limit.
+ // See https://go.dev/issue/69813.
+ syscall.Syscall15(procSetEvent.Addr(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+ syscall.Syscall18(procSetEvent.Addr(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+}
+
var (
modwinmm = syscall.NewLazyDLL("winmm.dll")
modkernel32 = syscall.NewLazyDLL("kernel32.dll")