File webkitgtk-commit-size.patch of Package webkitgtk

From: Mike Gorse <mgorse@suse.com>
Date: Thu Apr 10 16:45:50 CDT 2014
Subject: [patch] Set the commit size to the kernel page size

Ppc and other architectures support multiple page sizes, so we
should not try to predict the kernel page size at runtime.

Patch adapted from https://bugzilla.redhat.com/show_bug.cgi?id=1074093.
diff -ur webkitgtk-2.2.6.orig/Source/JavaScriptCore/interpreter/JSStack.cpp webkitgtk-2.2.6/Source/JavaScriptCore/interpreter/JSStack.cpp
--- webkitgtk-2.2.6.orig/Source/JavaScriptCore/interpreter/JSStack.cpp	2014-03-19 02:53:02.000000000 -0500
+++ webkitgtk-2.2.6/Source/JavaScriptCore/interpreter/JSStack.cpp	2014-04-10 16:57:20.555885207 -0500
@@ -49,7 +49,9 @@
 {
     ASSERT(capacity && isPageAligned(capacity));
 
-    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
+    // TODO how to set it only one time commitSize (replaced here by commitsize)
+    size_t commitsize = pageSize();
+    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitsize), OSAllocator::JSVMStackPages);
     m_end = static_cast<Register*>(m_reservation.base());
     m_commitEnd = static_cast<Register*>(m_reservation.base());
 
@@ -75,10 +77,12 @@
         return true;
     }
 
+    // TODO how to set it only one time commitSize (replaced here by commitsize)
+    size_t commitsize = pageSize();
     // Compute the chunk size of additional memory to commit, and see if we
     // have it is still within our budget. If not, we'll fail to grow and
     // return false.
-    long delta = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize);
+    long delta = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitsize);
     if (reinterpret_cast<char*>(m_commitEnd) + delta > reinterpret_cast<char*>(m_useableEnd))
         return false;