diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qml/doc/src/javascript/finetuning.qdoc | 9 | ||||
| -rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/doc/src/javascript/finetuning.qdoc b/src/qml/doc/src/javascript/finetuning.qdoc index 97dc2421c5..61ac7d0c8f 100644 --- a/src/qml/doc/src/javascript/finetuning.qdoc +++ b/src/qml/doc/src/javascript/finetuning.qdoc @@ -82,9 +82,12 @@ Running JavaScript code can be influenced by a few environment variables, partic \li \c{QV4_MAX_CALL_DEPTH} \li Stack overflows when running (as opposed to compiling) JavaScript are prevented by controlling the call depth: the number of nested function invocations. By - default, an exception is generated if the call depth exceeds 1234. If it contains a - number, this environment variable overrides the maximum call depth. Beware that the - recursion limit when compiling JavaScript is not affected. + default, an exception is generated if the call depth exceeds a maximum number tuned + to the platform's default stack size. If the \c{QV4_MAX_CALL_DEPTH} environment + variable contains a number, this number is used as maximum call depth. Beware that + the recursion limit when compiling JavaScript is not affected. The default maximum + call depth is 1234 on most platforms. On QNX it is 640 because on QNX the default + stack size is smaller than on most platforms. \row \li \c{QV4_MM_AGGRESSIVE_GC} \li Setting this environment variable runs the garbage collector before each memory diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 89471797d7..aed640281f 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -362,7 +362,11 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) maxCallDepth = qEnvironmentVariableIntValue("QV4_MAX_CALL_DEPTH", &ok); if (!ok || maxCallDepth <= 0) { #if defined(QT_NO_DEBUG) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(address_sanitizer) +#ifdef Q_OS_QNX + maxCallDepth = 640; // QNX's stack is only 512k by default +#else maxCallDepth = 1234; +#endif #else // no (tail call) optimization is done, so there'll be a lot mare stack frames active maxCallDepth = 200; |
