Title: [149472] trunk/Source/WTF
Revision
149472
Author
[email protected]
Date
2013-05-01 18:22:55 -0700 (Wed, 01 May 2013)

Log Message

FastMalloc.cpp should use system defined page size instead of literal constant
https://bugs.webkit.org/show_bug.cgi?id=115502

Reviewed by Geoffrey Garen.

Updated kPageShift to be PAGE_SHIFT for Mac.  Changed kMaxSize to be fixed at 32K.
Updated kNumClasses for 4K and 16K page sizes.

* wtf/FastMalloc.cpp:
kPageShift: Changed this to be PAGE_SHIFT on mac.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (149471 => 149472)


--- trunk/Source/WTF/ChangeLog	2013-05-02 01:09:18 UTC (rev 149471)
+++ trunk/Source/WTF/ChangeLog	2013-05-02 01:22:55 UTC (rev 149472)
@@ -1,3 +1,16 @@
+2013-05-01  Michael Saboff  <[email protected]>
+
+        FastMalloc.cpp should use system defined page size instead of literal constant
+        https://bugs.webkit.org/show_bug.cgi?id=115502
+
+        Reviewed by Geoffrey Garen.
+
+        Updated kPageShift to be PAGE_SHIFT for Mac.  Changed kMaxSize to be fixed at 32K.
+        Updated kNumClasses for 4K and 16K page sizes.
+
+        * wtf/FastMalloc.cpp:
+        kPageShift: Changed this to be PAGE_SHIFT on mac.
+
 2013-05-01  Roger Fong  <[email protected]>
 
         Set Path in makefile for AppleWin.

Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (149471 => 149472)


--- trunk/Source/WTF/wtf/FastMalloc.cpp	2013-05-02 01:09:18 UTC (rev 149471)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp	2013-05-02 01:22:55 UTC (rev 149472)
@@ -628,12 +628,25 @@
 // Not all possible combinations of the following parameters make
 // sense.  In particular, if kMaxSize increases, you may have to
 // increase kNumClasses as well.
-static const size_t kPageShift  = 12;
+#if OS(DARWIN)
+#    define K_PAGE_SHIFT PAGE_SHIFT
+#    if (K_PAGE_SHIFT == 12)
+#        define K_NUM_CLASSES 68
+#    elif (K_PAGE_SHIFT == 14)
+#        define K_NUM_CLASSES 77
+#    else
+#        error "Unsupported PAGE_SHIFT amount"
+#    endif
+#else
+#    define K_PAGE_SHIFT 12
+#    define K_NUM_CLASSES 68
+#endif
+static const size_t kPageShift  = K_PAGE_SHIFT;
 static const size_t kPageSize   = 1 << kPageShift;
-static const size_t kMaxSize    = 8u * kPageSize;
+static const size_t kMaxSize    = 32u * 1024;
 static const size_t kAlignShift = 3;
 static const size_t kAlignment  = 1 << kAlignShift;
-static const size_t kNumClasses = 68;
+static const size_t kNumClasses = K_NUM_CLASSES;
 
 // Allocates a big block of memory for the pagemap once we reach more than
 // 128MB
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to