Changeset 253244 in webkit for trunk/Source/JavaScriptCore/heap
- Timestamp:
- Dec 6, 2019, 11:50:19 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore/heap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r252385 r253244 90 90 #include <wtf/Threading.h> 91 91 92 #if PLATFORM(IOS_FAMILY)92 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 93 93 #include <bmalloc/bmalloc.h> 94 94 #endif … … 131 131 return Options::miniVMHeapGrowthFactor() * heapSize; 132 132 133 #if PLATFORM(IOS_FAMILY)133 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 134 134 size_t memoryFootprint = bmalloc::api::memoryFootprint(); 135 135 if (memoryFootprint < ramSize * Options::smallHeapRAMFraction()) … … 540 540 bool Heap::overCriticalMemoryThreshold(MemoryThresholdCallType memoryThresholdCallType) 541 541 { 542 #if PLATFORM(IOS_FAMILY)543 if (memoryThresholdCallType == MemoryThresholdCallType::Direct || ++m_p recentAvailableMemoryCachedCallCount >= 100) {542 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 543 if (memoryThresholdCallType == MemoryThresholdCallType::Direct || ++m_percentAvailableMemoryCachedCallCount >= 100) { 544 544 m_overCriticalMemoryThreshold = bmalloc::api::percentAvailableMemoryInUse() > Options::criticalGCMemoryThreshold(); 545 m_p recentAvailableMemoryCachedCallCount = 0;545 m_percentAvailableMemoryCachedCallCount = 0; 546 546 } 547 547 … … 2341 2341 } 2342 2342 2343 #if PLATFORM(IOS_FAMILY)2343 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 2344 2344 // Get critical memory threshold for next cycle. 2345 2345 overCriticalMemoryThreshold(MemoryThresholdCallType::Direct); … … 2638 2638 size_t bytesAllowedThisCycle = m_maxEdenSize; 2639 2639 2640 #if PLATFORM(IOS_FAMILY)2640 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 2641 2641 if (overCriticalMemoryThreshold()) 2642 2642 bytesAllowedThisCycle = std::min(m_maxEdenSizeWhenCritical, bytesAllowedThisCycle); -
trunk/Source/JavaScriptCore/heap/Heap.h
r252024 r253244 741 741 Thread* m_currentThread { nullptr }; // It's OK if this becomes a dangling pointer. 742 742 743 #if PLATFORM(IOS_FAMILY)744 unsigned m_p recentAvailableMemoryCachedCallCount;745 bool m_overCriticalMemoryThreshold ;743 #if USE(BMALLOC_MEMORY_FOOTPRINT_API) 744 unsigned m_percentAvailableMemoryCachedCallCount { 0 }; 745 bool m_overCriticalMemoryThreshold { false }; 746 746 #endif 747 747
Note:
See TracChangeset
for help on using the changeset viewer.