Title: [197168] trunk/Source
Revision
197168
Author
[email protected]
Date
2016-02-26 09:04:18 -0800 (Fri, 26 Feb 2016)

Log Message

[Darwin] Use vm_kernel_page_size for WTF::pageSize().
<https://webkit.org/b/154726>

Reviewed by Antti Koivisto.

Source/WebKit2:

Use WTF::pageSize() for the SharedMemory page size.

* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::systemPageSize):

Source/WTF:

Make sure we use the right VM page size on Darwin systems.
On devices where the native page size is 4 KB, it's both
possible and profitable to madvise in smaller chunks.

* wtf/PageBlock.cpp:
(WTF::systemPageSize):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (197167 => 197168)


--- trunk/Source/WTF/ChangeLog	2016-02-26 17:00:50 UTC (rev 197167)
+++ trunk/Source/WTF/ChangeLog	2016-02-26 17:04:18 UTC (rev 197168)
@@ -1,3 +1,17 @@
+2016-02-26  Andreas Kling  <[email protected]>
+
+        [Darwin] Use vm_kernel_page_size for WTF::pageSize().
+        <https://webkit.org/b/154726>
+
+        Reviewed by Antti Koivisto.
+
+        Make sure we use the right VM page size on Darwin systems.
+        On devices where the native page size is 4 KB, it's both
+        possible and profitable to madvise in smaller chunks.
+
+        * wtf/PageBlock.cpp:
+        (WTF::systemPageSize):
+
 2016-02-25  Gavin Barraclough  <[email protected]>
 
         Replace RefCounter::Token implementation with RefPtr

Modified: trunk/Source/WTF/wtf/PageBlock.cpp (197167 => 197168)


--- trunk/Source/WTF/wtf/PageBlock.cpp	2016-02-26 17:00:50 UTC (rev 197167)
+++ trunk/Source/WTF/wtf/PageBlock.cpp	2016-02-26 17:04:18 UTC (rev 197168)
@@ -26,6 +26,10 @@
 #include "config.h"
 #include "PageBlock.h"
 
+#if OS(DARWIN)
+#include <mach/vm_page_size.h>
+#endif
+
 #if OS(UNIX)
 #include <unistd.h>
 #endif
@@ -40,10 +44,17 @@
 static size_t s_pageSize;
 static size_t s_pageMask;
 
-#if OS(UNIX)
+#if OS(DARWIN)
 
 inline size_t systemPageSize()
 {
+    return vm_kernel_page_size;
+}
+
+#elif OS(UNIX)
+
+inline size_t systemPageSize()
+{
     return getpagesize();
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (197167 => 197168)


--- trunk/Source/WebKit2/ChangeLog	2016-02-26 17:00:50 UTC (rev 197167)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-26 17:04:18 UTC (rev 197168)
@@ -1,3 +1,15 @@
+2016-02-26  Andreas Kling  <[email protected]>
+
+        [Darwin] Use vm_kernel_page_size for WTF::pageSize().
+        <https://webkit.org/b/154726>
+
+        Reviewed by Antti Koivisto.
+
+        Use WTF::pageSize() for the SharedMemory page size.
+
+        * Platform/mac/SharedMemoryMac.cpp:
+        (WebKit::SharedMemory::systemPageSize):
+
 2016-02-25  Ryuan Choi  <[email protected]>
 
         [EFL] Remove WebUIPopupMenuClient

Modified: trunk/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp (197167 => 197168)


--- trunk/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp	2016-02-26 17:00:50 UTC (rev 197167)
+++ trunk/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp	2016-02-26 17:04:18 UTC (rev 197168)
@@ -35,6 +35,7 @@
 #include <mach/mach_error.h>
 #include <mach/mach_port.h>
 #include <mach/vm_map.h>
+#include <wtf/PageBlock.h>
 #include <wtf/RefPtr.h>
 
 namespace WebKit {
@@ -217,7 +218,7 @@
 
 unsigned SharedMemory::systemPageSize()
 {
-    return vm_page_size;
+    return WTF::pageSize();
 }
 
 WebCore::MachSendRight SharedMemory::createSendRight(Protection protection) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to