2016-05-03 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 20:54:51 +0000 (20:54 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 20:54:51 +0000 (20:54 +0000)
        Assertion failure in bmalloc::vmRevokePermissions(void*, unsigned long).
        https://bugs.webkit.org/show_bug.cgi?id=157047

        Reviewed by Filip Pizlo.

        Renamed roundUpToMultipleOfSloppy => roundUpToMultipleOfNonPowerOfTwo.

        * bmalloc/Algorithm.h:
        (bmalloc::roundUpToMultipleOfNonPowerOfTwo):
        (bmalloc::roundUpToMultipleOfSloppy): Deleted.
        * bmalloc/VMHeap.cpp:
        (bmalloc::VMHeap::allocateSmallChunk):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/Algorithm.h
Source/bmalloc/bmalloc/VMHeap.cpp

index 4c9c972..bbc9100 100644 (file)
@@ -5,6 +5,21 @@
 
         Reviewed by Filip Pizlo.
 
+        Renamed roundUpToMultipleOfSloppy => roundUpToMultipleOfNonPowerOfTwo.
+
+        * bmalloc/Algorithm.h:
+        (bmalloc::roundUpToMultipleOfNonPowerOfTwo):
+        (bmalloc::roundUpToMultipleOfSloppy): Deleted.
+        * bmalloc/VMHeap.cpp:
+        (bmalloc::VMHeap::allocateSmallChunk):
+
+2016-05-03  Geoffrey Garen  <ggaren@apple.com>
+
+        Assertion failure in bmalloc::vmRevokePermissions(void*, unsigned long).
+        https://bugs.webkit.org/show_bug.cgi?id=157047
+
+        Reviewed by Filip Pizlo.
+
         The previous fix aligned the guard page sizes correctly but forgot to
         align the guard page start address correctly.
 
index 8d4e2a7..6ac792e 100644 (file)
@@ -101,7 +101,7 @@ template<typename T> inline T divideRoundingUp(T numerator, T denominator)
     return (numerator + denominator - 1) / denominator;
 }
 
-template<typename T> inline T roundUpToMultipleOfSloppy(size_t divisor, T x)
+template<typename T> inline T roundUpToMultipleOfNonPowerOfTwo(size_t divisor, T x)
 {
     return divideRoundingUp(x, divisor) * divisor;
 }
index 9975c90..33c2d6b 100644 (file)
@@ -68,7 +68,7 @@ void VMHeap::allocateSmallChunk(std::lock_guard<StaticMutex>& lock, size_t pageC
     // guarantee that we can service aligned allocation requests at equal
     // and smaller powers of two.
     size_t vmPageSize = roundUpToMultipleOf(bmalloc::vmPageSize(), pageSize);
-    size_t metadataSize = roundUpToMultipleOfSloppy(vmPageSize, sizeof(Chunk));
+    size_t metadataSize = roundUpToMultipleOfNonPowerOfTwo(vmPageSize, sizeof(Chunk));
 
     Object begin(chunk, metadataSize);
     Object end(chunk, chunkSize);