about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-02 04:22:23 +0000
committerbors <bors@rust-lang.org>2018-08-02 04:22:23 +0000
commitdb5476571d9b27c862b95c1e64764b0ac8980e23 (patch)
tree3789d995d04ca786bdb61a277fc1522728f03316 /src/rustllvm/PassWrapper.cpp
parent60c1ee7645299a3a62a4908173a82b9f0fe7bc03 (diff)
parentfc8bb9c42c998dc5e82347d53f318b28d91fc9e3 (diff)
downloadrust-db5476571d9b27c862b95c1e64764b0ac8980e23.tar.gz
rust-db5476571d9b27c862b95c1e64764b0ac8980e23.zip
Auto merge of #52847 - upsuper:thread-stack-reserve, r=alexcrichton
Don't commit thread stack on Windows

On Windows, there is a system level resource limitation called commit limit, which is roughly the sum of physical memory + paging files[1]. `CreateThread` by default commits the stack size[2], which unnecessarily takes such resource from the shared limit.

This PR changes it to only reserve the stack size rather than commit it. Reserved memory would only take the address space of the current process until it's actually accessed.

This should make the behavior on Windows match other platforms, and is also a pretty standard practice on Windows nowadays.

[1] https://blogs.technet.microsoft.com/markrussinovich/2008/11/17/pushing-the-limits-of-windows-virtual-memory/
[2] https://docs.microsoft.com/zh-cn/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createthread
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions