The following code states that stack_size rounds up to the next 64 kB:
|
// 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); |
However, if stack is any of 0xffff * x + 1 (where x is a non-negative number) it will not properly round up. Additionally, the least significant byte is retained, I doubt that is intended either. Am I missing something? Otherwise I believe it's meant to be 0xffff instead of 0xfffe to properly round up.
The following code states that
stack_sizerounds up to the next 64 kB:rust/library/std/src/sys/windows/thread.rs
Lines 31 to 33 in 97cde9f
However, if
stackis any of0xffff * x + 1(where x is a non-negative number) it will not properly round up. Additionally, the least significant byte is retained, I doubt that is intended either. Am I missing something? Otherwise I believe it's meant to be0xffffinstead of0xfffeto properly round up.