We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 713f43e + 6564a8b commit 86cc11aCopy full SHA for 86cc11a
stdlib/public/stubs/Stubs.cpp
@@ -64,6 +64,7 @@ static long double swift_strtold_l(const char *nptr,
64
#include <xlocale.h>
65
#endif
66
#include <limits>
67
+#include <thread>
68
#include "llvm/ADT/StringExtras.h"
69
#include "llvm/Support/Compiler.h"
70
#include "swift/Runtime/Debug.h"
@@ -537,11 +538,5 @@ int swift::_swift_stdlib_putc_stderr(int C) {
537
538
}
539
540
size_t swift::_swift_stdlib_getHardwareConcurrency() {
-#if defined(_WIN32)
541
- SYSTEM_INFO SystemInfo;
542
- GetSystemInfo(&SystemInfo);
543
- return SystemInfo.dwNumberOfProcessors;
544
-#else
545
- return sysconf(_SC_NPROCESSORS_ONLN);
546
-#endif
+ return std::thread::hardware_concurrency();
547
0 commit comments