Changeset 237399 in webkit


Ignore:
Timestamp:
Oct 24, 2018 2:01:27 PM (5 years ago)
Author:
ap@apple.com
Message:

Add BPLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190878

Reviewed by Saam Barati.

  • bmalloc/AvailableMemory.cpp:

(bmalloc::memorySizeAccordingToKernel):
(bmalloc::computeAvailableMemory):

  • bmalloc/AvailableMemory.h:

(bmalloc::isUnderMemoryPressure):

  • bmalloc/BPlatform.h:
  • bmalloc/Gigacage.h:
  • bmalloc/Logging.cpp:

(bmalloc::logVMFailure):

  • bmalloc/VMAllocate.h:

(bmalloc::vmPageSizePhysical):

  • bmalloc/bmalloc.h:
  • bmalloc/darwin/MemoryStatusSPI.h:
Location:
trunk/Source/bmalloc
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r237080 r237399  
     12018-10-24  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Add BPLATFORM(IOS_FAMILY)
     4        https://bugs.webkit.org/show_bug.cgi?id=190878
     5
     6        Reviewed by Saam Barati.
     7
     8        * bmalloc/AvailableMemory.cpp:
     9        (bmalloc::memorySizeAccordingToKernel):
     10        (bmalloc::computeAvailableMemory):
     11        * bmalloc/AvailableMemory.h:
     12        (bmalloc::isUnderMemoryPressure):
     13        * bmalloc/BPlatform.h:
     14        * bmalloc/Gigacage.h:
     15        * bmalloc/Logging.cpp:
     16        (bmalloc::logVMFailure):
     17        * bmalloc/VMAllocate.h:
     18        (bmalloc::vmPageSizePhysical):
     19        * bmalloc/bmalloc.h:
     20        * bmalloc/darwin/MemoryStatusSPI.h:
     21
    1222018-10-12  Ryan Haddad  <ryanhaddad@apple.com>
    223
  • trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp

    r234328 r237399  
    2727
    2828#include "Environment.h"
    29 #if BPLATFORM(IOS)
     29#if BPLATFORM(IOS_FAMILY)
    3030#include "MemoryStatusSPI.h"
    3131#endif
     
    3535#include <mutex>
    3636#if BOS(DARWIN)
    37 #if BPLATFORM(IOS)
     37#if BPLATFORM(IOS_FAMILY)
    3838#import <algorithm>
    3939#endif
     
    5454static size_t memorySizeAccordingToKernel()
    5555{
    56 #if BPLATFORM(IOS_SIMULATOR)
     56#if BPLATFORM(IOS_FAMILY_SIMULATOR)
    5757    BUNUSED_PARAM(availableMemoryGuess);
    5858    // Pretend we have 1024MB of memory to make cache sizes behave like on device.
     
    7676#endif
    7777
    78 #if BPLATFORM(IOS)
     78#if BPLATFORM(IOS_FAMILY)
    7979static size_t jetsamLimit()
    8080{
     
    9393#if BOS(DARWIN)
    9494    size_t sizeAccordingToKernel = memorySizeAccordingToKernel();
    95 #if BPLATFORM(IOS)
     95#if BPLATFORM(IOS_FAMILY)
    9696    sizeAccordingToKernel = std::min(sizeAccordingToKernel, jetsamLimit());
    9797#endif
     
    122122}
    123123
    124 #if BPLATFORM(IOS)
     124#if BPLATFORM(IOS_FAMILY)
    125125MemoryStatus memoryStatus()
    126126{
  • trunk/Source/bmalloc/bmalloc/AvailableMemory.h

    r217918 r237399  
    3333size_t availableMemory();
    3434
    35 #if BPLATFORM(IOS)
     35#if BPLATFORM(IOS_FAMILY)
    3636struct MemoryStatus {
    3737    MemoryStatus(size_t memoryFootprint, double percentAvailableMemoryInUse)
     
    6262inline bool isUnderMemoryPressure()
    6363{
    64 #if BPLATFORM(IOS)
     64#if BPLATFORM(IOS_FAMILY)
    6565    return percentAvailableMemoryInUse() > memoryPressureThreshold;
    6666#else
  • trunk/Source/bmalloc/bmalloc/BPlatform.h

    r233192 r237399  
    5454
    5555#if BOS(DARWIN) && !defined(BUILDING_WITH_CMAKE)
    56 #if TARGET_OS_IPHONE
     56#if TARGET_OS_IOS
    5757#define BPLATFORM_IOS 1
    5858#if TARGET_OS_SIMULATOR
    5959#define BPLATFORM_IOS_SIMULATOR 1
    6060#endif
     61#endif
     62#if TARGET_OS_IPHONE
     63#define BPLATFORM_IOS_FAMILY 1
     64#if TARGET_OS_SIMULATOR
     65#define BPLATFORM_IOS_FAMILY_SIMULATOR 1
     66#endif
    6167#elif TARGET_OS_MAC
    6268#define BPLATFORM_MAC 1
     
    6470#endif
    6571
    66 #if BPLATFORM(MAC) || BPLATFORM(IOS)
     72#if BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY)
    6773#define BPLATFORM_COCOA 1
    6874#endif
     
    223229#define BATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
    224230
    225 #if (BPLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || BPLATFORM(IOS)
     231#if BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY)
    226232#define BUSE_OS_LOG 1
    227233#endif
    228234
    229 #if !defined(BUSE_EXPORT_MACROS) && (BPLATFORM(MAC) || BPLATFORM(IOS))
     235#if !defined(BUSE_EXPORT_MACROS) && (BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY))
    230236#define BUSE_EXPORT_MACROS 1
    231237#endif
     
    239245#define ENABLE_PHYSICAL_PAGE_MAP 0
    240246
    241 #if ((BPLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (BPLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000) || (BPLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 120000)) \
    242     && (BCPU(ARM64) || BCPU(ARM))
     247#if BPLATFORM(IOS_FAMILY) && (BCPU(ARM64) || BCPU(ARM))
    243248#define BUSE_CHECK_NANO_MALLOC 1
    244249#else
  • trunk/Source/bmalloc/bmalloc/Gigacage.h

    r232059 r237399  
    6060
    6161#if ((BOS(DARWIN) || BOS(LINUX)) && \
    62     (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300))))
     62    (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS_FAMILY) || BPLATFORM(IOS)))))
    6363#define GIGACAGE_ENABLED 1
    6464#else
  • trunk/Source/bmalloc/bmalloc/Logging.cpp

    r223936 r237399  
    3232#endif
    3333
    34 #if BPLATFORM(IOS)
     34#if BPLATFORM(IOS_FAMILY)
    3535#include <CoreFoundation/CoreFoundation.h>
    3636#include <mach/exception_types.h>
     
    4747void logVMFailure(size_t vmSize)
    4848{
    49 #if BPLATFORM(IOS)
     49#if BPLATFORM(IOS_FAMILY)
    5050    const mach_exception_data_type_t kExceptionCode = 0xc105ca11;
    5151    CFStringRef description = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("bmalloc failed to mmap %lu bytes"), vmSize);
  • trunk/Source/bmalloc/bmalloc/VMAllocate.h

    r234913 r237399  
    9797inline size_t vmPageSizePhysical()
    9898{
    99 #if BPLATFORM(IOS)
     99#if BPLATFORM(IOS_FAMILY)
    100100    return vm_kernel_page_size;
    101101#else
  • trunk/Source/bmalloc/bmalloc/bmalloc.h

    r232269 r237399  
    106106}
    107107   
    108 #if BPLATFORM(IOS)
     108#if BPLATFORM(IOS_FAMILY)
    109109inline size_t memoryFootprint()
    110110{
  • trunk/Source/bmalloc/bmalloc/darwin/MemoryStatusSPI.h

    r234326 r237399  
    2727#include "BPlatform.h"
    2828
    29 #if BPLATFORM(IOS)
     29#if BPLATFORM(IOS_FAMILY)
    3030
    3131#if __has_include(<System/sys/kern_memorystatus.h>)
     
    5252}
    5353
    54 #endif // BPLATFORM(IOS)
     54#endif // BPLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.