From: Jędrzej Nowacki Date: Mon, 22 Oct 2012 13:17:19 +0000 (+0200) Subject: Fix mmap usage. X-Git-Tag: archive/raspbian/4%4.8.7+dfsg-15+rpi1~1^2^2^2~44 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=29db84bcb96d87057e4f20408ce396c10072b788;p=qt4-x11.git Fix mmap usage. Add missing MAP_NORESERVE and fix error checking. Special thanks to Olivier JG for debugging the issue. Task-number: QTBUG-27322 Change-Id: Ia9f4aa80415f0127318714912b524131a5b0f18a Gbp-Pq: Name add_missing_map_noreserve.patch --- diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp index 16d0fb1e8..e1237e417 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp @@ -305,8 +305,8 @@ public: randomLocation += (1 << 24); randomLocation <<= 21; #endif - m_base = mmap(reinterpret_cast(randomLocation), m_totalHeapSize, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0); - if (!m_base) + m_base = mmap(reinterpret_cast(randomLocation), m_totalHeapSize, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0); + if (m_base == MAP_FAILED) CRASH(); // For simplicity, we keep all memory in m_freeList in a 'released' state.