Ignore:
Timestamp:
Dec 6, 2019, 11:50:19 PM (5 years ago)
Author:
[email protected]
Message:

[GTK][WPE] Use bmalloc's memory footprint API for JSC heap growth management
https://bugs.webkit.org/show_bug.cgi?id=204576

Reviewed by Saam Barati.

Source/JavaScriptCore:

Use the new USE(BMALLOC_MEMORY_FOOTPRINT_API) build guard to enable
bmalloc-based JSC heap growth management on iOS family ports as well
as additionally the Linux-based ports, if the configuration allows it
(i.e. system malloc enforcement kept disabled).

  • heap/Heap.cpp:

(JSC::Heap::overCriticalMemoryThreshold):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::collectIfNecessaryOrDefer):

  • heap/Heap.h:

Initialize the two member variables and fix a typo in one of them.

  • runtime/Options.cpp:

(JSC::overrideDefaults):
Also guard two default overrides with the new flag.

Source/WTF:

Add the new USE_BMALLOC_MEMORY_FOOTPRINT_API, enabled for the iOS-family
ports and the Linux ports, as long as system malloc enforcement is
disabled and bmalloc is subsequently built and used. The flag is used in
JavaScriptCore to enable usage of bmalloc's memory footprint API for
JSC heap growth control.

  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r252024 r253244  
    741741    Thread* m_currentThread { nullptr }; // It's OK if this becomes a dangling pointer.
    742742
    743 #if PLATFORM(IOS_FAMILY)
    744     unsigned m_precentAvailableMemoryCachedCallCount;
    745     bool m_overCriticalMemoryThreshold;
     743#if USE(BMALLOC_MEMORY_FOOTPRINT_API)
     744    unsigned m_percentAvailableMemoryCachedCallCount { 0 };
     745    bool m_overCriticalMemoryThreshold { false };
    746746#endif
    747747
Note: See TracChangeset for help on using the changeset viewer.