improve
This commit is contained in:
parent
02b0fe86f2
commit
3fa8837068
1 changed files with 3 additions and 3 deletions
|
@ -37,15 +37,15 @@ int32_t get_num_physical_cores() {
|
|||
}
|
||||
}
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
int num_physical_cores;
|
||||
int32_t num_physical_cores;
|
||||
size_t len = sizeof(num_physical_cores);
|
||||
int result = sysctlbyname("hw.perflevel0.physicalcpu", &num_physical_cores, &len, NULL, 0);
|
||||
if (result == 0) {
|
||||
return (int32_t) num_physical_cores;
|
||||
return num_physical_cores;
|
||||
}
|
||||
result = sysctlbyname("hw.physicalcpu", &num_physical_cores, &len, NULL, 0);
|
||||
if (result == 0) {
|
||||
return (int32_t) num_physical_cores;
|
||||
return num_physical_cores;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
SYSTEM_INFO sysinfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue