rust/src/libstd/sys/windows
bors db5476571d 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
2018-08-02 04:22:23 +00:00
..
backtrace Change traits to bare FnMut where possible. 2018-06-28 21:57:08 +00:00
ext Add missing allow_missing_docs 2018-06-13 23:30:35 +02:00
args.rs Better Debug for Args and ArgsOs 2017-06-21 15:40:45 +03:00
c.rs Don't commit thread stack on Windows 2018-07-30 14:02:09 +10:00
cmath.rs std: Move the cmath module into the sys module 2017-11-08 20:42:23 -08:00
compat.rs Use #[prelude_import] in libstd. 2016-08-24 22:12:48 +00:00
condvar.rs Use monotonic time with condition variables. 2016-07-31 12:47:52 +02:00
dynamic_lib.rs Use #[prelude_import] in libstd. 2016-08-24 22:12:48 +00:00
env.rs std: Move platform specific env code into sys 2016-10-01 19:32:59 +00:00
fast_thread_local.rs rustc: Enable #[thread_local] for Windows 2017-06-23 16:11:39 -07:00
fs.rs Add an unstable FileTypeExt extension trait for Windows 2018-02-11 13:40:46 -05:00
handle.rs Add Read::initializer. 2017-06-20 20:26:22 -07:00
memchr.rs Move rust memchr impl to libcore 2017-12-13 01:15:18 -06:00
mod.rs std: Avoid use of libc in portable modules 2017-11-09 07:56:44 -08:00
mutex.rs Use box syntax instead of Box::new in Mutex::remutex on Windows 2018-04-04 19:30:46 +09:00
net.rs Implement TcpStream::connect_timeout 2017-07-06 19:35:49 -07:00
os.rs Add current_pid function 2017-10-06 01:15:49 -06:00
os_str.rs Implement shrink_to method on collections 2018-03-27 01:39:11 +01:00
path.rs Remove import of now unused AsciiExt 2017-11-04 19:16:03 +01:00
pipe.rs typos 2018-04-05 13:04:00 +02:00
process.rs Replace push loops with collect() and extend() where possible 2018-07-29 18:53:22 +02:00
rand.rs std: Remove rand crate and module 2017-11-08 20:41:17 -08:00
rwlock.rs Register new snapshots 2015-08-11 15:11:13 -07:00
stack_overflow.rs Fix warnings during tests 2016-01-26 09:29:28 -08:00
stdio.rs std: Minimize size of panicking on wasm 2018-04-13 07:03:00 -07:00
thread.rs Don't commit thread stack on Windows 2018-07-30 14:02:09 +10:00
thread_local.rs std: Flag Windows TLS dtor symbol as #[used] 2017-11-24 14:28:12 -08:00
time.rs Add Hash impl for SystemTime and Instant 2017-12-19 00:35:43 +03:00