We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2495418 commit c21ba97Copy full SHA for c21ba97
std/src/sys/pal/unix/thread.rs
@@ -489,9 +489,11 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
489
fn vxCpuEnabledGet() -> libc::cpuset_t;
490
}
491
492
- // always fetches a valid bitmask
493
- let set = unsafe { vxCpuEnabledGet() };
494
- Ok(NonZero::new_unchecked(set.count_ones() as usize))
+ unsafe{
+ // always fetches a valid bitmask
+ let set = vxCpuEnabledGet();
495
+ Ok(NonZero::new_unchecked(set.count_ones() as usize))
496
+ }
497
} else {
498
// FIXME: implement on Redox, l4re
499
Err(io::const_io_error!(io::ErrorKind::Unsupported, "Getting the number of hardware threads is not supported on the target platform"))
0 commit comments