Title: [209014] trunk/Source/WebCore
Revision
209014
Author
krol...@apple.com
Date
2016-11-28 13:57:56 -0800 (Mon, 28 Nov 2016)

Log Message

Unreviewed, rolling out r208607.

The actual changes aren't inline with what was requested.

Reverted changeset:

"Reduce number of platformMemoryUsage calls"
https://bugs.webkit.org/show_bug.cgi?id=164375
http://trac.webkit.org/changeset/208607

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209013 => 209014)


--- trunk/Source/WebCore/ChangeLog	2016-11-28 21:42:56 UTC (rev 209013)
+++ trunk/Source/WebCore/ChangeLog	2016-11-28 21:57:56 UTC (rev 209014)
@@ -1,3 +1,15 @@
+2016-11-28  Keith Rollin  <krol...@apple.com>
+
+        Unreviewed, rolling out r208607.
+
+        The actual changes aren't inline with what was requested.
+
+        Reverted changeset:
+
+        "Reduce number of platformMemoryUsage calls"
+        https://bugs.webkit.org/show_bug.cgi?id=164375
+        http://trac.webkit.org/changeset/208607
+
 2016-11-28  Beth Dakin  <bda...@apple.com>
 
         Blacklist Netflix for TouchBar support

Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (209013 => 209014)


--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp	2016-11-28 21:42:56 UTC (rev 209013)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp	2016-11-28 21:57:56 UTC (rev 209014)
@@ -75,25 +75,19 @@
 #define MEMORYPRESSURE_LOG(...) WTFLogAlways(__VA_ARGS__)
 #endif
 
-    if (s_loggingEnabled) {
-        size_t currentMemory = platformMemoryUsage();
-        if (currentMemory == static_cast<size_t>(-1) || m_initialMemory == static_cast<size_t>(-1)) {
-            MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": (Unable to get dirty memory information for process)", m_logString);
-            return;
-        }
+    size_t currentMemory = platformMemoryUsage();
+    if (currentMemory == static_cast<size_t>(-1) || m_initialMemory == static_cast<size_t>(-1)) {
+        MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": (Unable to get dirty memory information for process)", m_logString);
+        return;
+    }
 
-        long memoryDiff = currentMemory - m_initialMemory;
-        if (memoryDiff < 0)
-            MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": -dirty %ld bytes (from %zu to %zu)", m_logString, (memoryDiff * -1), m_initialMemory, currentMemory);
-        else if (memoryDiff > 0)
-            MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": +dirty %ld bytes (from %zu to %zu)", m_logString, memoryDiff, m_initialMemory, currentMemory);
-        else
-            MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": =dirty (at %zu bytes)", m_logString, currentMemory);
-#if !RELEASE_LOG_DISABLED
-    } else {
-        MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION, m_logString);
-#endif
-    }
+    long memoryDiff = currentMemory - m_initialMemory;
+    if (memoryDiff < 0)
+        MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": -dirty %ld bytes (from %zu to %zu)", m_logString, (memoryDiff * -1), m_initialMemory, currentMemory);
+    else if (memoryDiff > 0)
+        MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": +dirty %ld bytes (from %zu to %zu)", m_logString, memoryDiff, m_initialMemory, currentMemory);
+    else
+        MEMORYPRESSURE_LOG("Memory pressure relief: " STRING_SPECIFICATION ": =dirty (at %zu bytes)", m_logString, currentMemory);
 }
 
 #if !PLATFORM(COCOA) && !OS(LINUX) && !PLATFORM(WIN)

Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.h (209013 => 209014)


--- trunk/Source/WebCore/platform/MemoryPressureHandler.h	2016-11-28 21:42:56 UTC (rev 209013)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.h	2016-11-28 21:57:56 UTC (rev 209014)
@@ -90,13 +90,22 @@
     public:
         explicit ReliefLogger(const char *log)
             : m_logString(log)
+#if !RELEASE_LOG_DISABLED
+            , m_initialMemory(platformMemoryUsage())
+#else
             , m_initialMemory(s_loggingEnabled ? platformMemoryUsage() : 0)
+#endif
         {
         }
 
         ~ReliefLogger()
         {
+#if !RELEASE_LOG_DISABLED
             logMemoryUsageChange();
+#else
+            if (s_loggingEnabled)
+                logMemoryUsageChange();
+#endif
         }
 
         const char* logString() const { return m_logString; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to