aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-02-16 14:19:25 +0100
committerOliver Wolff <oliver.wolff@qt.io>2018-02-22 06:30:29 +0000
commitab03ee7b7e12ae64556513e4791b0d4d55ea26c4 (patch)
tree936f18188bf52ce75bbc50e4428cd3953feb00f3 /src/qml/jsruntime/qv4engine.cpp
parentc9398266d804d570f305590df9481028c9880175 (diff)
WinRT: Do not call canAllocateExecutableMemory from static initializer
When the code generation capability is not set, the first call of canAllocateExecutableMemory will cause a warning about suboptimal performance. The qWarning code checks, which thread caused the message and QThread::current sets QCoreApplicationPrivate;s theMainThread when it is called for the first time on Windows. If we call that function inside a static initializer, it will be called before QCoreApplication is created and thus set the main thread to the one that called the function. This will cause a warning about QApplication not being created inside the main() thread, but more importantly, delivering of events will not work in WinRT applications afterwards. Task-number: QTBUG-66418 Change-Id: I3b6bf804983644b5ae5fe2288a587dc95fab2c8b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index ce29afdb6c..4b5aadbdcf 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -120,9 +120,6 @@ QQmlEngine *ExecutionEngine::qmlEngine() const
#endif // V4_BOOTSTRAP
qint32 ExecutionEngine::maxCallDepth = -1;
-#if defined(V4_ENABLE_JIT) && !defined(V4_BOOTSTRAP)
-const bool ExecutionEngine::canAllocateExecutableMemory = OSAllocator::canAllocateExecutableMemory();
-#endif
ExecutionEngine::ExecutionEngine()
: executableAllocator(new QV4::ExecutableAllocator)
@@ -137,6 +134,9 @@ ExecutionEngine::ExecutionEngine()
, m_engineId(engineSerial.fetchAndAddOrdered(1))
, regExpCache(0)
, m_multiplyWrappedQObjects(0)
+#if defined(V4_ENABLE_JIT) && !defined(V4_BOOTSTRAP)
+ , m_canAllocateExecutableMemory(OSAllocator::canAllocateExecutableMemory())
+#endif
{
memoryManager = new QV4::MemoryManager(this);