aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2017-02-28 08:54:28 +0100
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-02-28 08:15:24 +0000
commit0f9b39909fb7023f7936b4311c13dbaa571ddbe6 (patch)
treed3ec7f891df25684b0fdb6d3e646c2d66e37b247 /src/3rdparty
parent4b949a2eb4e6ab245e8fc5214926c78eff4488da (diff)
winrt: Fix application startup
commit() was never implemented for the WinRT version of the OS Allocator. This commits fixes this under following setup - you have to use x86 or x64 - you have to use the experimental JIT For any of the other situations followup patches will follow. Task-number: QTBUG-59198 Change-Id: Ie87012ab2879139e27d63ac4bb96fe46905f7dfd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
index 0a6eda8b98..15703017f6 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
@@ -98,16 +98,23 @@ void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bo
return result;
}
-void OSAllocator::commit(void*, size_t, bool, bool)
+void OSAllocator::commit(void *bytes, size_t size, bool writable, bool executable)
{
- CRASH(); // Unimplemented
+ if (qt_winrt_use_jit) {
+ void *result = VirtualAllocFromApp(bytes, size, MEM_COMMIT,
+ protection(writable, executable));
+ if (!result)
+ CRASH();
+ }
}
-void OSAllocator::decommit(void* address, size_t)
+void OSAllocator::decommit(void* address, size_t bytes)
{
- if (qt_winrt_use_jit)
- Q_UNREACHABLE();
- else
+ if (qt_winrt_use_jit) {
+ bool result = VirtualFree(address, bytes, MEM_DECOMMIT);
+ if (!result)
+ CRASH();
+ } else
_aligned_free(address);
}