diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2017-02-01 12:14:08 -0500 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2017-02-02 13:13:30 -0500 |
commit | 611b493648e64678fccac94373707e12e3904e91 (patch) | |
tree | 410a0164ae298f16631a85192bd250af3503a767 | |
parent | 5405365648a784d736ce8e1aa97ff7f4eb09c3aa (diff) | |
download | mongo-611b493648e64678fccac94373707e12e3904e91.tar.gz |
SERVER-27643 Use correct types when setting javascript stack limit
-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 72de902359a..d660149ae2d 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -321,16 +321,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); |