Skip to main content

STACK_SIZE

Constant STACK_SIZE 

Source
const STACK_SIZE: usize = _; // 2_088_960usize
Expand description

We want our default stack size limit to be approximately 2MB, to be safe for JS helper tasks that can use a lot of stack, but expect most threads to use much less. On Linux, however, requesting a stack of 2MB or larger risks the kernel allocating an entire 2MB huge page for it on first access, which we do not want. To avoid this possibility, we subtract 2 standard VM page sizes from our default.

https://searchfox.org/mozilla-central/rev/cb5faf5dd5176494302068c553da97b4d08aa339/xpcom/threads/TaskController.cpp#43