]> Cypherpunks repositories - gostls13.git/commit
runtime: call unlockOSThread directly in Windows syscall functions
authorCherry Mui <cherryyz@google.com>
Thu, 6 May 2021 16:24:20 +0000 (12:24 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 6 May 2021 20:30:00 +0000 (20:30 +0000)
commit4dbad795100bc0f5f9419bbb44b1ff0beb60a88c
tree3b8a718ee08aab9d398b596145a10d05e71a28fc
parentf39997b2bebd54416bfb437fa1484fd8a5f43abb
runtime: call unlockOSThread directly in Windows syscall functions

Windows syscall functions (e.g. syscall.Syscall9) are defined as
cgo_unsafe_args (because it takes the address of one argument and
use that to access all arguments) which makes them ABI0. In some
case we may need ABI wrappers for them. Because those functions
have a large number of arguments, the wrapper can take a
non-trivial amount of stack frame, causing nosplit overflow when
inlining is disabled. The overflow call chain involves
deferreturn.

This CL changes a deferred call to unlockOSThread to a direct
call. If the syscall functions panics, it is likely a fatal error
anyway.

Fixes #45698.

Change-Id: I280be826644de1205f9c8f5efaa4ec5e1b4eebc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/316650
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/syscall_windows.go