Title: [168353] trunk/Source/WTF
Revision
168353
Author
[email protected]
Date
2014-05-06 03:58:05 -0700 (Tue, 06 May 2014)

Log Message

There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD
https://bugs.webkit.org/show_bug.cgi?id=132542

Reviewed by Michael Saboff.

Use sysconf() to get the number of processor cores.

* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (168352 => 168353)


--- trunk/Source/WTF/ChangeLog	2014-05-06 06:54:23 UTC (rev 168352)
+++ trunk/Source/WTF/ChangeLog	2014-05-06 10:58:05 UTC (rev 168353)
@@ -1,3 +1,15 @@
+2014-05-06  Alberto Garcia  <[email protected]>
+
+        There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD
+        https://bugs.webkit.org/show_bug.cgi?id=132542
+
+        Reviewed by Michael Saboff.
+
+        Use sysconf() to get the number of processor cores.
+
+        * wtf/NumberOfCores.cpp:
+        (WTF::numberOfProcessorCores):
+
 2014-05-04  Darin Adler  <[email protected]>
 
         RetainPtr: Use adoptCF function instead of AdoptCF constructor argument

Modified: trunk/Source/WTF/wtf/NumberOfCores.cpp (168352 => 168353)


--- trunk/Source/WTF/wtf/NumberOfCores.cpp	2014-05-06 06:54:23 UTC (rev 168352)
+++ trunk/Source/WTF/wtf/NumberOfCores.cpp	2014-05-06 10:58:05 UTC (rev 168353)
@@ -26,13 +26,13 @@
 #include "config.h"
 #include "NumberOfCores.h"
 
-#if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
+#if OS(DARWIN)
 #include <sys/param.h>
 // sys/types.h must come before sys/sysctl.h because the latter uses
 // data types defined in the former. See sysctl(3) and style(9).
 #include <sys/types.h>
 #include <sys/sysctl.h>
-#elif OS(LINUX) || OS(AIX) || OS(SOLARIS)
+#elif OS(LINUX) || OS(AIX) || OS(SOLARIS) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
 #include <unistd.h>
 #elif OS(WINDOWS)
 #include <windows.h>
@@ -48,7 +48,7 @@
     if (s_numberOfCores > 0)
         return s_numberOfCores;
 
-#if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
+#if OS(DARWIN)
     unsigned result;
     size_t length = sizeof(result);
     int name[] = {
@@ -58,7 +58,7 @@
     int sysctlResult = sysctl(name, sizeof(name) / sizeof(int), &result, &length, 0, 0);
 
     s_numberOfCores = sysctlResult < 0 ? defaultIfUnavailable : result;
-#elif OS(LINUX) || OS(AIX) || OS(SOLARIS)
+#elif OS(LINUX) || OS(AIX) || OS(SOLARIS) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
     long sysconfResult = sysconf(_SC_NPROCESSORS_ONLN);
 
     s_numberOfCores = sysconfResult < 0 ? defaultIfUnavailable : static_cast<int>(sysconfResult);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to