mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Don't round stack size up for created threads
This commit is contained in:
@@ -28,12 +28,9 @@ pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
|
||||
// PTHREAD_STACK_MIN bytes big. Windows has no such lower limit, it's
|
||||
// just that below a certain threshold you can't do anything useful.
|
||||
// That threshold is application and architecture-specific, however.
|
||||
// Round up to the next 64 kB because that's what the NT kernel does,
|
||||
// might as well make it explicit.
|
||||
let stack_size = (stack + 0xfffe) & (!0xfffe);
|
||||
let ret = c::CreateThread(
|
||||
ptr::null_mut(),
|
||||
stack_size,
|
||||
stack,
|
||||
thread_start,
|
||||
p as *mut _,
|
||||
c::STACK_SIZE_PARAM_IS_A_RESERVATION,
|
||||
|
||||
Reference in New Issue
Block a user