runtime: simplify nr_cpus

pull/13223/head
Delyan Angelov 2022-01-19 19:29:29 +02:00
parent d714dcef75
commit d63f395061
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 4 deletions

View File

@ -4,8 +4,5 @@ fn C.sysconf(name int) i64
// nr_cpus returns the number of virtual CPU cores found on the system.
pub fn nr_cpus() int {
$if linux || macos || solaris {
return int(C.sysconf(C._SC_NPROCESSORS_ONLN))
}
return 1
return int(C.sysconf(C._SC_NPROCESSORS_ONLN))
}