diff options
| author | Xidorn Quan <me@upsuper.org> | 2018-07-30 14:02:09 +1000 |
|---|---|---|
| committer | Xidorn Quan <me@upsuper.org> | 2018-07-30 14:02:09 +1000 |
| commit | fc8bb9c42c998dc5e82347d53f318b28d91fc9e3 (patch) | |
| tree | 18320c3ccef199b89d366033e34438694fefd63a /src/libstd/sys/windows | |
| parent | 70cac59031d5c33962a1f53cdca9359c0dcd1f9f (diff) | |
| download | rust-fc8bb9c42c998dc5e82347d53f318b28d91fc9e3.tar.gz rust-fc8bb9c42c998dc5e82347d53f318b28d91fc9e3.zip | |
Don't commit thread stack on Windows
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/c.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/thread.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs index 30aba2f400f..6f81afe66f9 100644 --- a/src/libstd/sys/windows/c.rs +++ b/src/libstd/sys/windows/c.rs @@ -296,6 +296,8 @@ pub const PIPE_READMODE_BYTE: DWORD = 0x00000000; pub const FD_SETSIZE: usize = 64; +pub const STACK_SIZE_PARAM_IS_A_RESERVATION: DWORD = 0x00010000; + #[repr(C)] #[cfg(not(target_pointer_width = "64"))] pub struct WSADATA { diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index 44ec872b244..85588cc6c8e 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -42,7 +42,8 @@ impl Thread { let stack_size = (stack + 0xfffe) & (!0xfffe); let ret = c::CreateThread(ptr::null_mut(), stack_size, thread_start, &*p as *const _ as *mut _, - 0, ptr::null_mut()); + c::STACK_SIZE_PARAM_IS_A_RESERVATION, + ptr::null_mut()); return if ret as usize == 0 { Err(io::Error::last_os_error()) |
