diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2017-02-01 12:14:08 -0500 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2018-04-16 11:55:06 -0400 |
commit | 90ef0561dd788959e246321112942e78282fd87d (patch) | |
tree | 64f202d918f43e1bcff7300442f3896fd3f5df3b | |
parent | f0299d35a0e91246fa95005c78319bcabd43494d (diff) | |
download | mongo-90ef0561dd788959e246321112942e78282fd87d.tar.gz |
SERVER-27643 Use correct types when setting javascript stack limit
(cherry picked from commit 611b493648e64678fccac94373707e12e3904e91)
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index c31d5b940a4..3896c274d43 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -365,16 +365,16 @@ MozJSImplScope::MozRuntime::MozRuntime(const MozJSScriptEngine* engine) { // // TODO: What if we are running on a platform with very // large pages, like 4MB? - const int available_stack_space = available.get(); + const auto available_stack_space = available.get(); #if defined(__powerpc64__) && defined(MONGO_CONFIG_DEBUG_BUILD) // From experimentation, we need a larger reservation of 96k since debug ppc64le code // needs more stack space to process stack overflow. In debug builds, more variables are // stored on the stack which increases the stack pressure. It does not affects non-debug // builds. - const int reserve_stack_space = 96 * 1024; + const decltype(available_stack_space) reserve_stack_space = 96 * 1024; #else - const int reserve_stack_space = 64 * 1024; + const decltype(available_stack_space) reserve_stack_space = 64 * 1024; #endif JS_SetNativeStackQuota(_runtime.get(), available_stack_space - reserve_stack_space); |