From fd8d3b0c645a42467547e8ebc5df953946a7e27c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 5 Mar 2015 08:31:50 +0100 Subject: 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 --- src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/3rdparty/masm') 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); -- cgit v1.2.3