mirror of
https://github.com/google/benchmark.git
synced 2025-03-31 14:40:29 +08:00
Replace usage of deprecated sysctl on macOS (#1919)
The use of the sysctl hw.ncpu has long been deprecated and should be replaced by hw.logicalcpu.
This commit is contained in:
parent
41e81b1ca4
commit
faaa266d33
@ -483,7 +483,9 @@ int GetNumCPUsImpl() {
|
||||
#ifdef BENCHMARK_HAS_SYSCTL
|
||||
int num_cpu = -1;
|
||||
constexpr auto* hwncpu =
|
||||
#ifdef HW_NCPUONLINE
|
||||
#if defined BENCHMARK_OS_MACOSX
|
||||
"hw.logicalcpu";
|
||||
#elif defined(HW_NCPUONLINE)
|
||||
"hw.ncpuonline";
|
||||
#else
|
||||
"hw.ncpu";
|
||||
|
Loading…
Reference in New Issue
Block a user