Changeset 180666 in webkit
- Timestamp:
- Feb 26, 2015 12:15:04 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r180661 r180666 1 2015-02-26 Andreas Kling <akling@apple.com> 2 3 [Cocoa] Prod libcache to drop caches in memory pressure relief handler. 4 <https://webkit.org/b/142024> 5 <rdar://problem/19966096> 6 7 Reviewed by Antti Koivisto. 8 9 libcache already listens to the OS memory pressure notifications, but we still 10 need to manually request a cleanup when doing an iOS process suspension, or when 11 simulating memory pressure. 12 13 * platform/cocoa/MemoryPressureHandlerCocoa.mm: 14 (WebCore::MemoryPressureHandler::platformReleaseMemory): Call out to libcache's 15 cache_simulate_memory_warning_event() to make sure that nonessential objects 16 being kept alive by NSCaches get dropped when we need the memory. 17 1 18 2015-02-25 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm
r180225 r180666 1 1 /* 2 * Copyright (C) 2011-201 4Apple Inc. All Rights Reserved.2 * Copyright (C) 2011-2015 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 45 45 #endif 46 46 47 extern "C" void cache_simulate_memory_warning_event(uint64_t); 48 47 49 namespace WebCore { 48 50 49 void MemoryPressureHandler::platformReleaseMemory(bool )51 void MemoryPressureHandler::platformReleaseMemory(bool critical) 50 52 { 51 53 { … … 59 61 IOSurfacePool::sharedPool().discardAllSurfaces(); 60 62 } 63 #endif 64 65 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 66 if (critical && !isUnderMemoryPressure()) { 67 // libcache listens to OS memory notifications, but for process suspension 68 // or memory pressure simulation, we need to prod it manually: 69 ReliefLogger log("Purging libcache caches"); 70 cache_simulate_memory_warning_event(DISPATCH_MEMORYPRESSURE_CRITICAL); 71 } 72 #else 73 UNUSED_PARAM(critical); 61 74 #endif 62 75
Note: See TracChangeset
for help on using the changeset viewer.