aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
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);
}