diff options
Diffstat (limited to 'src/qml/jsruntime/qv4mm.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4mm.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp index 625e34de07..d55ddead89 100644 --- a/src/qml/jsruntime/qv4mm.cpp +++ b/src/qml/jsruntime/qv4mm.cpp @@ -234,12 +234,17 @@ MemoryManager::MemoryManager() # else void* stackBottom = 0; pthread_attr_t attr; - pthread_getattr_np(pthread_self(), &attr); - size_t stackSize = 0; - pthread_attr_getstack(&attr, &stackBottom, &stackSize); - pthread_attr_destroy(&attr); + if (pthread_getattr_np(pthread_self(), &attr) == 0) { + size_t stackSize = 0; + pthread_attr_getstack(&attr, &stackBottom, &stackSize); + pthread_attr_destroy(&attr); - m_d->stackTop = static_cast<quintptr *>(stackBottom) + stackSize/sizeof(quintptr); + m_d->stackTop = static_cast<quintptr *>(stackBottom) + stackSize/sizeof(quintptr); + } else { + // can't scan the native stack so have to rely on exact gc + m_d->stackTop = 0; + m_d->exactGC = true; + } # endif #elif OS(WINCE) if (false && g_stackBase) { |