Title: [164742] trunk/Source/WTF
Revision
164742
Author
barraclo...@apple.com
Date
2014-02-26 13:17:35 -0800 (Wed, 26 Feb 2014)

Log Message

FastMalloc should use vm_page_shift intead of PAGE_SHIFT.
https://bugs.webkit.org/show_bug.cgi?id=129370

Reviewed by Mark Rowe.

"Doesn't this lead to the page map using fewer bits than it was before?
It seems like this will cause some page addresses to no longer be
representable in the map when using 4K pages. Am I missing something?"

* wtf/FastMalloc.cpp:
    - bdash raises a valid point. This should make the TCMalloc_PageMap
      larger than absolutely necessary, rather than potentially too small.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (164741 => 164742)


--- trunk/Source/WTF/ChangeLog	2014-02-26 21:13:03 UTC (rev 164741)
+++ trunk/Source/WTF/ChangeLog	2014-02-26 21:17:35 UTC (rev 164742)
@@ -1,3 +1,18 @@
+2014-02-26  Gavin Barraclough  <barraclo...@apple.com>
+
+        FastMalloc should use vm_page_shift intead of PAGE_SHIFT.
+        https://bugs.webkit.org/show_bug.cgi?id=129370
+
+        Reviewed by Mark Rowe.
+
+        "Doesn't this lead to the page map using fewer bits than it was before?
+        It seems like this will cause some page addresses to no longer be
+        representable in the map when using 4K pages. Am I missing something?"
+
+        * wtf/FastMalloc.cpp:
+            - bdash raises a valid point. This should make the TCMalloc_PageMap
+              larger than absolutely necessary, rather than potentially too small.
+
 2014-02-25  Gavin Barraclough  <barraclo...@apple.com>
 
         FastMalloc should use vm_page_shift intead of PAGE_SHIFT.

Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (164741 => 164742)


--- trunk/Source/WTF/wtf/FastMalloc.cpp	2014-02-26 21:13:03 UTC (rev 164741)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp	2014-02-26 21:17:35 UTC (rev 164742)
@@ -636,6 +636,7 @@
 // Not all possible combinations of the following parameters make
 // sense.  In particular, if kMaxSize increases, you may have to
 // increase kNumClasses as well.
+#define K_PAGE_SHIFT_MIN 12
 #define K_PAGE_SHIFT_MAX 14
 #define K_NUM_CLASSES_MAX 77
 static size_t kPageShift  = 0;
@@ -1664,7 +1665,7 @@
 // Selector class -- general selector uses 3-level map
 template <int BITS> class MapSelector {
  public:
-  typedef TCMalloc_PageMap3<BITS-K_PAGE_SHIFT_MAX> Type;
+  typedef TCMalloc_PageMap3<BITS-K_PAGE_SHIFT_MIN> Type;
   typedef PackedCache<BITS, uint64_t> CacheType;
 };
 
@@ -1682,7 +1683,7 @@
 // A three-level map for 64-bit machines
 template <> class MapSelector<64> {
  public:
-  typedef TCMalloc_PageMap3<64 - K_PAGE_SHIFT_MAX - kBitsUnusedOn64Bit> Type;
+  typedef TCMalloc_PageMap3<64 - K_PAGE_SHIFT_MIN - kBitsUnusedOn64Bit> Type;
   typedef PackedCache<64, uint64_t> CacheType;
 };
 #endif
@@ -1690,8 +1691,8 @@
 // A two-level map for 32-bit machines
 template <> class MapSelector<32> {
  public:
-  typedef TCMalloc_PageMap2<32 - K_PAGE_SHIFT_MAX> Type;
-  typedef PackedCache<32 - K_PAGE_SHIFT_MAX, uint16_t> CacheType;
+  typedef TCMalloc_PageMap2<32 - K_PAGE_SHIFT_MIN> Type;
+  typedef PackedCache<32 - K_PAGE_SHIFT_MIN, uint16_t> CacheType;
 };
 
 // -------------------------------------------------------------------------
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to