aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm/wtf
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2015-03-05 08:31:50 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2015-03-05 15:52:58 +0000
commitfd8d3b0c645a42467547e8ebc5df953946a7e27c (patch)
treebd0d5459792f2c3b1e4de95c65e65c2970d5baab /src/3rdparty/masm/wtf
parentf1b7fa93a35c799f69fb0f55aa457b30eb217eef (diff)
WinRT: Set alignment boundary to page size
This is a hard requirement from the QQmlEngine internals since 5.5 and otherwise causes crashes inside the engine. Change-Id: Id25f465576a0095f5b34da469abe761d3f3bd866 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Diffstat (limited to 'src/3rdparty/masm/wtf')
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
index 9b8f5bf46b..ba251d2ecf 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
@@ -33,9 +33,17 @@
namespace WTF {
+inline size_t getPageSize()
+{
+ SYSTEM_INFO info;
+ GetNativeSystemInfo(&info);
+ return info.dwPageSize;
+}
+
void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool, bool)
{
- void* result = _aligned_malloc(bytes, 16);
+ static const size_t pageSize = getPageSize();
+ void* result = _aligned_malloc(bytes, pageSize);
if (!result)
CRASH();
memset(result, 0, bytes);