the statuscode command.\r
Thanks to Kirill Kovalenko for reporting a crash with NANO server.\r
Thanks to Connor Reynolds for spotting a potential buffer overflow.\r
+Thanks to foi for spotting a hang with 64 cores.\r
\r
Licence\r
-------\r
int num_cpus() {\r
DWORD_PTR i, affinity, system_affinity;\r
if (! GetProcessAffinityMask(GetCurrentProcess(), &affinity, &system_affinity)) return 64;\r
- for (i = 0; system_affinity & (1LL << i); i++);\r
+ for (i = 0; system_affinity & (1LL << i); i++) if (i == 64) break;\r
return (int) i;\r
}\r
\r