[WTF] Compilation fails with system malloc
authorberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 16:32:36 +0000 (16:32 +0000)
committerberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 16:32:36 +0000 (16:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172445

Reviewed by Michael Catanzaro.

Follow-up to r217270. The sysinfo() system call is specific to
Linux so update the #ifdef checks accordingly.

* wtf/RAMSize.cpp:
(WTF::computeRAMSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/RAMSize.cpp

index c95c5cb..ac52ca0 100644 (file)
@@ -1,3 +1,16 @@
+2019-01-16  Alberto Garcia  <berto@igalia.com>
+
+        [WTF] Compilation fails with system malloc
+        https://bugs.webkit.org/show_bug.cgi?id=172445
+
+        Reviewed by Michael Catanzaro.
+
+        Follow-up to r217270. The sysinfo() system call is specific to
+        Linux so update the #ifdef checks accordingly.
+
+        * wtf/RAMSize.cpp:
+        (WTF::computeRAMSize):
+
 2019-01-15  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, revert part of r239997 as it is not needed to fix the build.
index b64dfea..2e69ba9 100644 (file)
@@ -32,9 +32,9 @@
 #if OS(WINDOWS)
 #include <windows.h>
 #elif defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC
-#if OS(UNIX)
+#if OS(LINUX)
 #include <sys/sysinfo.h>
-#endif // OS(UNIX)
+#endif // OS(LINUX)
 #else
 #include <bmalloc/bmalloc.h>
 #endif
@@ -55,13 +55,13 @@ static size_t computeRAMSize()
         return ramSizeGuess;
     return status.ullTotalPhys;
 #elif defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC
-#if OS(UNIX)
+#if OS(LINUX)
     struct sysinfo si;
     sysinfo(&si);
     return si.totalram * si.mem_unit;
 #else
 #error "Missing a platform specific way of determining the available RAM"
-#endif // OS(UNIX)
+#endif // OS(LINUX)
 #else
     return bmalloc::api::availableMemory();
 #endif