improve
This commit is contained in:
parent
b17d54eda3
commit
02b0fe86f2
1 changed files with 4 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue