Rare case of not properly rounding up thread stack size on Windows #94454
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-help-wanted
Call for participation: Help is requested to fix this issue.
O-windows
Operating system: Windows
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
The following code states that
stack_size
rounds up to the next 64 kB:rust/library/std/src/sys/windows/thread.rs
Lines 31 to 33 in 97cde9f
However, if
stack
is 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 be0xffff
instead of0xfffe
to properly round up.The text was updated successfully, but these errors were encountered: