Fix minor issue with usage of STL thread::hardware_concurrency()

This commit is contained in:
Eladash 2021-01-28 20:33:50 +02:00 committed by Ivan
parent 11ba6e45ab
commit d3bc96a201
9 changed files with 24 additions and 13 deletions

View file

@ -409,13 +409,18 @@ u64 utils::get_total_memory()
u32 utils::get_thread_count()
{
static const u32 g_count = []()
{
#ifdef _WIN32
::SYSTEM_INFO sysInfo;
::GetNativeSystemInfo(&sysInfo);
return sysInfo.dwNumberOfProcessors;
::SYSTEM_INFO sysInfo;
::GetNativeSystemInfo(&sysInfo);
return sysInfo.dwNumberOfProcessors;
#else
return ::sysconf(_SC_NPROCESSORS_ONLN);
return ::sysconf(_SC_NPROCESSORS_ONLN);
#endif
}();
return g_count;
}
u32 utils::get_cpu_family()