Commit aa825c5c authored by Pranav Thulasiram Bhat's avatar Pranav Thulasiram Bhat Committed by Facebook GitHub Bot

Raise stackSizeMultiplier for debug builds

Summary:
Debug builds can be prone to stack overflows if they are configurated to use the same stack sizes as prod builds.

This diff effectively doubles the stack size for debug builds to provide more buffer against overflows.

Reviewed By: yfeldblum

Differential Revision: D21913754

fbshipit-source-id: bd32cc4dd9c79a50be178e5d6d30804a83e60ee4
parent cb47018e
......@@ -88,11 +88,13 @@ class FiberManager : public ::folly::Executor {
/**
* Sanitizers need a lot of extra stack space. 16x is a conservative
* estimate, but 8x also worked with tests where it mattered. Note that
* over-allocating here does not necessarily increase RSS, since unused
* memory is pretty much free.
* estimate, but 8x also worked with tests where it mattered. Similarly,
* debug builds need extra stack space due to reduced inlining.
*
* Note that over-allocating here does not necessarily increase RSS, since
* unused memory is pretty much free.
*/
size_t stackSizeMultiplier{kIsSanitize ? 16 : 1};
size_t stackSizeMultiplier{kIsSanitize ? 16 : (kIsDebug ? 2 : 1)};
/**
* Record exact amount of stack used.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment