[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

ggaren at apple.com ggaren at apple.com
Wed Dec 22 18:05:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b3300ce43ad36f9e8253da44e1c14fd9cc1552c6
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 6 23:14:10 2010 +0000

    reserveAndCommit doesn't commit on MADVISE_FREE_REUSE systems
    https://bugs.webkit.org/show_bug.cgi?id=50588
    
    Reviewed by Maciej Stachowiak.
    
    * wtf/OSAllocatorPosix.cpp:
    (WTF::OSAllocator::reserve):
    (WTF::OSAllocator::reserveAndCommit):
    (WTF::OSAllocator::commit): Tightened up some comments. Changed
    reserveAndCommit to actually commit on MADVISE_FREE_REUSE systems.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 9fad92c..d376dbf 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-06  Geoffrey Garen  <ggaren at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        reserveAndCommit doesn't commit on MADVISE_FREE_REUSE systems
+        https://bugs.webkit.org/show_bug.cgi?id=50588
+        
+        * wtf/OSAllocatorPosix.cpp:
+        (WTF::OSAllocator::reserve):
+        (WTF::OSAllocator::reserveAndCommit):
+        (WTF::OSAllocator::commit): Tightened up some comments. Changed
+        reserveAndCommit to actually commit on MADVISE_FREE_REUSE systems.
+
 2010-12-06  Patrick Gansterer  <paroga at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/JavaScriptCore/wtf/OSAllocatorPosix.cpp b/JavaScriptCore/wtf/OSAllocatorPosix.cpp
index 147fefe..c1c3bb6 100644
--- a/JavaScriptCore/wtf/OSAllocatorPosix.cpp
+++ b/JavaScriptCore/wtf/OSAllocatorPosix.cpp
@@ -35,11 +35,11 @@ namespace WTF {
 
 void* OSAllocator::reserve(size_t bytes)
 {
-    // From a bookkeeping perspective, POSIX reservations start out in the committed state.
     void* result = mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
     if (result == MAP_FAILED)
         CRASH();
 #if HAVE(MADV_FREE_REUSE)
+    // To support the "reserve then commit" model, we have to initially decommit.
     while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
 #endif
     return result;
@@ -47,8 +47,11 @@ void* OSAllocator::reserve(size_t bytes)
 
 void* OSAllocator::reserveAndCommit(size_t bytes)
 {
-    // From a bookkeeping perspective, POSIX reservations start out in the committed state.
-    return reserve(bytes);
+    // All POSIX reservations start out logically committed.
+    void* result = mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+    if (result == MAP_FAILED)
+        CRASH();
+    return result;
 }
 
 void OSAllocator::commit(void* address, size_t bytes)
@@ -56,6 +59,7 @@ void OSAllocator::commit(void* address, size_t bytes)
 #if HAVE(MADV_FREE_REUSE)
     while (madvise(address, bytes, MADV_FREE_REUSE) == -1 && errno == EAGAIN) { }
 #else
+    // Non-MADV_FREE_REUSE reservations automatically commit on demand.
     UNUSED_PARAM(address);
     UNUSED_PARAM(bytes);
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list