Bug 856670 - Bring JS C stack limit closer to actual OS limits (r=bsmedberg)

This commit is contained in:
Bill McCloskey 2013-04-25 21:02:22 -07:00
parent f71c8746ba
commit 4da563b989

View File

@ -2691,6 +2691,12 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
// between optimized and debug builds. Also, ASan requires more stack space
// due to redzones
JS_SetNativeStackQuota(mJSRuntime, 2 * 128 * sizeof(size_t) * 1024);
#elif defined(XP_WIN)
// 1MB is the default stack size on Windows
JS_SetNativeStackQuota(mJSRuntime, 900 * 1024);
#elif defined(XP_MACOSX) || defined(DARWIN)
// 8MB is the default stack size on MacOS
JS_SetNativeStackQuota(mJSRuntime, 7 * 1024 * 1024);
#else
JS_SetNativeStackQuota(mJSRuntime, 128 * sizeof(size_t) * 1024);
#endif