]> Cypherpunks repositories - gostls13.git/commit
runtime: always use 2MB stacks on 64-bit Windows
authorAustin Clements <austin@google.com>
Mon, 17 Jul 2017 18:18:49 +0000 (14:18 -0400)
committerAustin Clements <austin@google.com>
Tue, 18 Jul 2017 14:35:35 +0000 (14:35 +0000)
commitc2c07c798940f484eece7a57af568783f8a02839
tree56019ed8b76315fe6e1d97cba7fbeffe1bb9fc9e
parente9b9dfe3f71a8b9f5006616f877836c67eb4fba0
runtime: always use 2MB stacks on 64-bit Windows

Currently, Windows stacks are either 128kB or 2MB depending on whether
the binary uses cgo. This is because we assume that Go system stacks
and the small amount of C code invoked by the standard library can
operate within smaller stacks, but general Windows C code assumes
larger stacks.

However, it's easy to call into arbitrary C code using the syscall
package on Windows without ever importing cgo into a binary. Such
binaries need larger system stacks even though they don't use cgo.

Fix this on 64-bit by increasing the system stack size to 2MB always.
This only costs address space, which is free enough on 64-bit to not
worry about. We keep (for now) the existing heuristic on 32-bit, where
address space comes at more of a premium.

Updates #20975.

Change-Id: Iaaaa9a2fcbadc825cddc797aaaea8d34ef8debf2
Reviewed-on: https://go-review.googlesource.com/49331
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/cmd/link/internal/ld/pe.go
src/runtime/os_windows.go