VxWorks: Add safety comment for vxCpuEnabledGet · patricklam/verify-rust-std@39b1eaf (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 39b1eaf
and
authored
VxWorks: Add safety comment for vxCpuEnabledGet
Co-authored-by: Trevor Gross t.gross35@gmail.com
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -477,8 +477,8 @@ pub fn available_parallelism() -> io::Result<NonZero> { | ||
477 | 477 | fn vxCpuEnabledGet() -> libc::cpuset_t; |
478 | 478 | } |
479 | 479 | |
480 | +// SAFETY: `vxCpuEnabledGet` always fetches a mask with at least one bit set | |
480 | 481 | unsafe{ |
481 | -// always fetches a valid bitmask | |
482 | 482 | let set = vxCpuEnabledGet(); |
483 | 483 | Ok(NonZero::new_unchecked(set.count_ones() as usize)) |
484 | 484 | } |