Changeset 235215 in webkit
- Timestamp:
- Aug 22, 2018, 8:01:40 PM (7 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r235129 r235215 1 2018-08-22 Don Olmstead <don.olmstead@sony.com> 2 3 [WTF] Add generic implementation for Memory querying 4 https://bugs.webkit.org/show_bug.cgi?id=188867 5 6 Reviewed by Fujii Hironori. 7 8 Moves generic implementation of MemoryPressureHandler from 9 MemoryPressureHandler.cpp into MemoryPressureHandlerGeneric 10 and generic implementation of memoryFootprint from 11 MemoryFootprintLinux.cpp to MemoryFootprintGeneric. 12 13 * wtf/MemoryPressureHandler.cpp: 14 (WTF::MemoryPressureHandler::install): Deleted. 15 (WTF::MemoryPressureHandler::uninstall): Deleted. 16 (WTF::MemoryPressureHandler::respondToMemoryPressure): Deleted. 17 (WTF::MemoryPressureHandler::platformReleaseMemory): Deleted. 18 (WTF::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Deleted. 19 * wtf/PlatformJSCOnly.cmake: 20 * wtf/generic/MemoryFootprintGeneric.cpp: Added. 21 (WTF::memoryFootprint): 22 * wtf/generic/MemoryPressureHandlerGeneric.cpp: Added. 23 (WTF::MemoryPressureHandler::memoryMeasurementTimerFired): 24 (WTF::MemoryPressureHandler::platformReleaseMemory): 25 (WTF::MemoryPressureHandler::install): 26 (WTF::MemoryPressureHandler::uninstall): 27 (WTF::MemoryPressureHandler::holdOff): 28 (WTF::MemoryPressureHandler::respondToMemoryPressure): 29 (WTF::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): 30 * wtf/linux/CurrentProcessMemoryStatus.cpp: 31 * wtf/linux/CurrentProcessMemoryStatus.h: 32 * wtf/linux/MemoryFootprintLinux.cpp: 33 (WTF::computeMemoryFootprint): 34 (WTF::memoryFootprint): 35 * wtf/linux/MemoryPressureHandlerLinux.cpp: 36 1 37 2018-08-21 Antti Koivisto <antti@apple.com> 2 38 -
trunk/Source/WTF/wtf/MemoryPressureHandler.cpp
r234733 r235215 295 295 } 296 296 297 #if !PLATFORM(COCOA) && !OS(LINUX) && !OS(WINDOWS)298 void MemoryPressureHandler::install() { }299 void MemoryPressureHandler::uninstall() { }300 void MemoryPressureHandler::respondToMemoryPressure(Critical, Synchronous) { }301 void MemoryPressureHandler::platformReleaseMemory(Critical) { }302 std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() { return std::nullopt; }303 #endif304 305 297 #if !OS(WINDOWS) 306 298 void MemoryPressureHandler::platformInitialize() { } -
trunk/Source/WTF/wtf/PlatformJSCOnly.cmake
r233401 r235215 31 31 ) 32 32 endif () 33 34 33 endif () 35 34 … … 58 57 ${DERIVED_SOURCES_WTF_DIR} 59 58 ) 59 elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") 60 list(APPEND WTF_SOURCES 61 linux/CurrentProcessMemoryStatus.cpp 62 linux/MemoryFootprintLinux.cpp 63 linux/MemoryPressureHandlerLinux.cpp 64 ) 65 list(APPEND WTF_PUBLIC_HEADERS 66 linux/CurrentProcessMemoryStatus.h 67 ) 60 68 else () 61 69 list(APPEND WTF_SOURCES 62 linux/MemoryFootprintLinux.cpp 70 generic/MemoryFootprintGeneric.cpp 71 generic/MemoryPressureHandlerGeneric.cpp 63 72 ) 64 73 endif () -
trunk/Source/WTF/wtf/linux/CurrentProcessMemoryStatus.cpp
r213214 r235215 26 26 #include "config.h" 27 27 #include "CurrentProcessMemoryStatus.h" 28 29 #if OS(LINUX)30 28 31 29 #include <stdio.h> … … 74 72 75 73 } // namespace WTF 76 77 #endif // OS(LINUX) -
trunk/Source/WTF/wtf/linux/CurrentProcessMemoryStatus.h
r213214 r235215 26 26 #pragma once 27 27 28 #if OS(LINUX)29 30 28 namespace WTF { 31 29 … … 46 44 using WTF::ProcessMemoryStatus; 47 45 using WTF::currentProcessMemoryStatus; 48 49 #endif // OS(LINUX) -
trunk/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp
r235113 r235215 27 27 #include "MemoryFootprint.h" 28 28 29 #if OS(LINUX)30 29 #include "MonotonicTime.h" 31 30 #include <stdio.h> 32 31 #include <wtf/StdLibExtras.h> 33 32 #include <wtf/text/StringView.h> 34 #endif35 33 36 34 namespace WTF { 37 35 38 #if OS(LINUX)39 36 static const Seconds s_memoryFootprintUpdateInterval = 1_s; 40 37 … … 89 86 return totalPrivateDirtyInKB * KB; 90 87 } 91 #endif92 88 93 89 size_t memoryFootprint() 94 90 { 95 #if OS(LINUX)96 91 static size_t footprint = 0; 97 92 static MonotonicTime previousUpdateTime = { }; … … 103 98 104 99 return footprint; 105 #endif106 return 0;107 100 } 108 101 109 } 102 } // namespace WTF -
trunk/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
r234733 r235215 28 28 #include "config.h" 29 29 #include "MemoryPressureHandler.h" 30 31 #if OS(LINUX)32 30 33 31 #include <malloc.h> … … 139 137 } 140 138 141 142 139 } // namespace WTF 143 144 #endif // OS(LINUX)
Note:
See TracChangeset
for help on using the changeset viewer.