Source/WTF/ChangeLog

 12014-05-05 Alberto Garcia <berto@igalia.com>
 2
 3 There is no HW_AVAILCPU on FreeBSD, NetBSD, and OpenBSD
 4 https://bugs.webkit.org/show_bug.cgi?id=132542
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Use sysconf() to get the number of processor cores.
 9
 10 * wtf/NumberOfCores.cpp:
 11 (WTF::numberOfProcessorCores):
 12
1132014-05-04 Andreas Kling <akling@apple.com>
214
315 Optimize JSRopeString for resolving directly to AtomicString.

Source/WTF/wtf/NumberOfCores.cpp

2626#include "config.h"
2727#include "NumberOfCores.h"
2828
29 #if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
 29#if OS(DARWIN)
3030#include <sys/param.h>
3131// sys/types.h must come before sys/sysctl.h because the latter uses
3232// data types defined in the former. See sysctl(3) and style(9).
3333#include <sys/types.h>
3434#include <sys/sysctl.h>
35 #elif OS(LINUX) || OS(AIX) || OS(SOLARIS)
 35#elif OS(LINUX) || OS(AIX) || OS(SOLARIS) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
3636#include <unistd.h>
3737#elif OS(WINDOWS)
3838#include <windows.h>

@@int numberOfProcessorCores()
4848 if (s_numberOfCores > 0)
4949 return s_numberOfCores;
5050
51 #if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
 51#if OS(DARWIN)
5252 unsigned result;
5353 size_t length = sizeof(result);
5454 int name[] = {

@@int numberOfProcessorCores()
5858 int sysctlResult = sysctl(name, sizeof(name) / sizeof(int), &result, &length, 0, 0);
5959
6060 s_numberOfCores = sysctlResult < 0 ? defaultIfUnavailable : result;
61 #elif OS(LINUX) || OS(AIX) || OS(SOLARIS)
 61#elif OS(LINUX) || OS(AIX) || OS(SOLARIS) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD)
6262 long sysconfResult = sysconf(_SC_NPROCESSORS_ONLN);
6363
6464 s_numberOfCores = sysconfResult < 0 ? defaultIfUnavailable : static_cast<int>(sysconfResult);