[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 21:44:39 +0000 (21:44 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 21:44:39 +0000 (21:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203109

Reviewed by Carlos Alberto Lopez Perez.

* MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
the sysctl() function will be used.

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

PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench/CPUCount.cpp

index fc9385d..fe4d355 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-17  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [Linux] Avoid usage of <sys/sysctl.h> in MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=203109
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
+        the sysctl() function will be used.
+
 2019-10-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
index 31d6d2d..f2433d7 100644 (file)
 #include "CPUCount.h"
 #include <stdlib.h>
 #include <sys/param.h>
-#include <sys/sysctl.h>
 #include <sys/types.h>
 #include <unistd.h>
 
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+#endif
+
 static size_t count;
 
 size_t cpuCount()