Title: [237399] trunk/Source/bmalloc
Revision
237399
Author
a...@apple.com
Date
2018-10-24 14:01:27 -0700 (Wed, 24 Oct 2018)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (237398 => 237399)


--- trunk/Source/bmalloc/ChangeLog	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/ChangeLog	2018-10-24 21:01:27 UTC (rev 237399)
@@ -1,3 +1,24 @@
+2018-10-24  Alexey Proskuryakov  <a...@apple.com>
+
+        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:
+
 2018-10-12  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r237063.

Modified: trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-10-24 21:01:27 UTC (rev 237399)
@@ -26,7 +26,7 @@
 #include "AvailableMemory.h"
 
 #include "Environment.h"
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 #include "MemoryStatusSPI.h"
 #endif
 #include "PerProcess.h"
@@ -34,7 +34,7 @@
 #include "Sizes.h"
 #include <mutex>
 #if BOS(DARWIN)
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 #import <algorithm>
 #endif
 #import <dispatch/dispatch.h>
@@ -53,7 +53,7 @@
 #if BOS(DARWIN)
 static size_t memorySizeAccordingToKernel()
 {
-#if BPLATFORM(IOS_SIMULATOR)
+#if BPLATFORM(IOS_FAMILY_SIMULATOR)
     BUNUSED_PARAM(availableMemoryGuess);
     // Pretend we have 1024MB of memory to make cache sizes behave like on device.
     return 1024 * bmalloc::MB;
@@ -75,7 +75,7 @@
 }
 #endif
 
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 static size_t jetsamLimit()
 {
     memorystatus_memlimit_properties_t properties;
@@ -92,7 +92,7 @@
 {
 #if BOS(DARWIN)
     size_t sizeAccordingToKernel = memorySizeAccordingToKernel();
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
     sizeAccordingToKernel = std::min(sizeAccordingToKernel, jetsamLimit());
 #endif
     size_t multiple = 128 * bmalloc::MB;
@@ -121,7 +121,7 @@
     return availableMemory;
 }
 
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 MemoryStatus memoryStatus()
 {
     task_vm_info_data_t vmInfo;

Modified: trunk/Source/bmalloc/bmalloc/AvailableMemory.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/AvailableMemory.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/AvailableMemory.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -32,7 +32,7 @@
 
 size_t availableMemory();
 
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 struct MemoryStatus {
     MemoryStatus(size_t memoryFootprint, double percentAvailableMemoryInUse)
         : memoryFootprint(memoryFootprint)
@@ -61,7 +61,7 @@
 
 inline bool isUnderMemoryPressure()
 {
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
     return percentAvailableMemoryInUse() > memoryPressureThreshold;
 #else
     return false;

Modified: trunk/Source/bmalloc/bmalloc/BPlatform.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/BPlatform.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/BPlatform.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -53,17 +53,23 @@
 #endif
 
 #if BOS(DARWIN) && !defined(BUILDING_WITH_CMAKE)
-#if TARGET_OS_IPHONE
+#if TARGET_OS_IOS
 #define BPLATFORM_IOS 1
 #if TARGET_OS_SIMULATOR
 #define BPLATFORM_IOS_SIMULATOR 1
 #endif
+#endif
+#if TARGET_OS_IPHONE
+#define BPLATFORM_IOS_FAMILY 1
+#if TARGET_OS_SIMULATOR
+#define BPLATFORM_IOS_FAMILY_SIMULATOR 1
+#endif
 #elif TARGET_OS_MAC
 #define BPLATFORM_MAC 1
 #endif
 #endif
 
-#if BPLATFORM(MAC) || BPLATFORM(IOS)
+#if BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY)
 #define BPLATFORM_COCOA 1
 #endif
 
@@ -222,11 +228,11 @@
 
 #define BATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
 
-#if (BPLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || BPLATFORM(IOS)
+#if BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY)
 #define BUSE_OS_LOG 1
 #endif
 
-#if !defined(BUSE_EXPORT_MACROS) && (BPLATFORM(MAC) || BPLATFORM(IOS))
+#if !defined(BUSE_EXPORT_MACROS) && (BPLATFORM(MAC) || BPLATFORM(IOS_FAMILY))
 #define BUSE_EXPORT_MACROS 1
 #endif
 
@@ -238,8 +244,7 @@
 /* This is used for debugging when hacking on how bmalloc calculates its physical footprint. */
 #define ENABLE_PHYSICAL_PAGE_MAP 0
 
-#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)) \
-    && (BCPU(ARM64) || BCPU(ARM))
+#if BPLATFORM(IOS_FAMILY) && (BCPU(ARM64) || BCPU(ARM))
 #define BUSE_CHECK_NANO_MALLOC 1
 #else
 #define BUSE_CHECK_NANO_MALLOC 0

Modified: trunk/Source/bmalloc/bmalloc/Gigacage.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/Gigacage.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/Gigacage.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -59,7 +59,7 @@
 #define JSVALUE_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(JSVALUE_GIGACAGE_SIZE)
 
 #if ((BOS(DARWIN) || BOS(LINUX)) && \
-    (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300))))
+    (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS_FAMILY) || BPLATFORM(IOS)))))
 #define GIGACAGE_ENABLED 1
 #else
 #define GIGACAGE_ENABLED 0

Modified: trunk/Source/bmalloc/bmalloc/Logging.cpp (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/Logging.cpp	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/Logging.cpp	2018-10-24 21:01:27 UTC (rev 237399)
@@ -31,7 +31,7 @@
 #include <stdio.h>
 #endif
 
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 #include <CoreFoundation/CoreFoundation.h>
 #include <mach/exception_types.h>
 #include <objc/objc.h>
@@ -46,7 +46,7 @@
 
 void logVMFailure(size_t vmSize)
 {
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
     const mach_exception_data_type_t kExceptionCode = 0xc105ca11;
     CFStringRef description = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("bmalloc failed to mmap %lu bytes"), vmSize);
     SimulateCrash(getpid(), kExceptionCode, description);

Modified: trunk/Source/bmalloc/bmalloc/VMAllocate.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/VMAllocate.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/VMAllocate.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -96,7 +96,7 @@
 
 inline size_t vmPageSizePhysical()
 {
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
     return vm_kernel_page_size;
 #else
     static size_t cached;

Modified: trunk/Source/bmalloc/bmalloc/bmalloc.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/bmalloc.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/bmalloc.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -105,7 +105,7 @@
     return bmalloc::availableMemory();
 }
     
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 inline size_t memoryFootprint()
 {
     return bmalloc::memoryFootprint();

Modified: trunk/Source/bmalloc/bmalloc/darwin/MemoryStatusSPI.h (237398 => 237399)


--- trunk/Source/bmalloc/bmalloc/darwin/MemoryStatusSPI.h	2018-10-24 20:41:45 UTC (rev 237398)
+++ trunk/Source/bmalloc/bmalloc/darwin/MemoryStatusSPI.h	2018-10-24 21:01:27 UTC (rev 237399)
@@ -26,7 +26,7 @@
 
 #include "BPlatform.h"
 
-#if BPLATFORM(IOS)
+#if BPLATFORM(IOS_FAMILY)
 
 #if __has_include(<System/sys/kern_memorystatus.h>)
 extern "C" {
@@ -51,4 +51,4 @@
 int memorystatus_control(uint32_t command, int32_t pid, uint32_t flags, void *buffer, size_t buffersize);
 }
 
-#endif // BPLATFORM(IOS)
+#endif // BPLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to