system: HW_NCPUONLINE is OpenBSD-specific.
Seems this was added to mitigate spectre and does not exist for FreeBSD. No other means of testing other platforms so enable this only with OpenBSD for now.
This commit is contained in:
parent
f472733f06
commit
5f76337553
|
@ -209,9 +209,7 @@ cpu_count(void)
|
|||
int
|
||||
system_cpu_online_count_get(void)
|
||||
{
|
||||
#if defined(__linux__)
|
||||
return cpu_count();
|
||||
#endif
|
||||
#if defined(__OpenBSD__)
|
||||
static int cores = 0;
|
||||
|
||||
if (cores != 0) return cores;
|
||||
|
@ -224,6 +222,9 @@ system_cpu_online_count_get(void)
|
|||
return cpu_count();
|
||||
|
||||
return cores;
|
||||
#else
|
||||
return cpu_count();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue