Skip to content

Commit b20d9f0

Browse files
biabbastgross35
andauthored
VxWorks: Add safety comment for vxCpuEnabledGet
Co-authored-by: Trevor Gross <t.gross35@gmail.com>
1 parent 2abcc6b commit b20d9f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/pal/unix/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
477477
fn vxCpuEnabledGet() -> libc::cpuset_t;
478478
}
479479

480+
// SAFETY: `vxCpuEnabledGet` always fetches a mask with at least one bit set
480481
unsafe{
481-
// always fetches a valid bitmask
482482
let set = vxCpuEnabledGet();
483483
Ok(NonZero::new_unchecked(set.count_ones() as usize))
484484
}

0 commit comments

Comments
 (0)