Skip to content

Commit 0675385

Browse files
committed
[libc++][Windows] Enable thread::hardware_concurrency to support more than 64 processors
1 parent 358e9a5 commit 0675385

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

libcxx/src/thread.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ unsigned thread::hardware_concurrency() noexcept {
7474
return 0;
7575
return static_cast<unsigned>(result);
7676
#elif defined(_LIBCPP_WIN32API)
77-
SYSTEM_INFO info;
78-
GetSystemInfo(&info);
79-
return info.dwNumberOfProcessors;
77+
return static_cast<unsigned>(GetActiveProcessorCount(ALL_PROCESSOR_GROUPS));
8078
#else // defined(CTL_HW) && defined(HW_NCPU)
8179
// TODO: grovel through /proc or check cpuid on x86 and similar
8280
// instructions on other architectures.

0 commit comments

Comments
 (0)