aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-26 10:01:56 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2013-11-26 10:02:56 +0100
commitee6aa999ab0439dcb7a95af3dc9905a6daf13491 (patch)
tree8c83fc72ce62676b8431a1226f9cb9d6f39da4a0 /src/qml/jsruntime/qv4engine.cpp
parentf449534020adc8623ebfced5daae331ef56c4421 (diff)
parentce38c71b1c300f700a9ff004b7c163cc290ecae9 (diff)
Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative into stable
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 90220f0a36..f5a515a0ae 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -95,7 +95,14 @@ quintptr getStackLimit()
pthread_t thread_self = pthread_self();
void *stackTop = pthread_get_stackaddr_np(thread_self);
stackLimit = reinterpret_cast<quintptr>(stackTop);
- stackLimit -= pthread_get_stacksize_np(thread_self);
+ quintptr size = 0;
+ if (pthread_main_np()) {
+ rlimit limit;
+ getrlimit(RLIMIT_STACK, &limit);
+ size = limit.rlim_cur;
+ } else
+ size = pthread_get_stacksize_np(thread_self);
+ stackLimit -= size;
# else
void* stackBottom = 0;
pthread_attr_t attr;