This commit is contained in:
jon-chuang 2023-04-14 03:55:33 +08:00
parent b17d54eda3
commit 02b0fe86f2

View file

@ -42,12 +42,11 @@ int32_t get_num_physical_cores() {
int result = sysctlbyname("hw.perflevel0.physicalcpu", &num_physical_cores, &len, NULL, 0);
if (result == 0) {
return (int32_t) num_physical_cores;
} else {
int result = sysctlbyname("hw.physicalcpu", &num_physical_cores, &len, NULL, 0);
}
result = sysctlbyname("hw.physicalcpu", &num_physical_cores, &len, NULL, 0);
if (result == 0) {
return (int32_t) num_physical_cores;
}
}
#elif defined(_WIN32)
SYSTEM_INFO sysinfo;
GetNativeSystemInfo(&sysinfo);