-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std library thread.rs: fix NetBSD code for ILP32 CPUs. #123038
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
Trading with Chris for some Unix API reviews now for Windows API reviews later. :^) |
for i in 0..u32::MAX { | ||
match libc::_cpuset_isset(i.into(), set) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument is an unsigned long, so why is this not c_ulong::MAX
, exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, because I know too little rust. :) And perhaps because I follow too closely in the footsteps already trodden, not wanting to deviate too far.
It's not as if the loop won't terminate long before any of those values are reached, so in practical terms the only difference would be the ability to get rid of the .into()
.
Or ... ideally one should be able to use cpuid_t::MAX
, or (a compilation attempt later) libc::cpuid_t::MAX
?
I've added a commit which makes that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, realistically it will never matter!
yeah, I mostly just want the alias to be "self-documenting". in this case it works because the alias means the type so the alias does indeed resolve to a type with an associated constant.
✌️ @he32, you can now approve this pull request! If @workingjubilee told you to " |
@bors r=@workingjubilee |
…bilee std library thread.rs: fix NetBSD code for ILP32 CPUs.
@bors rollup=always |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#122439 (match lowering: build the `Place` instead of keeping a `PlaceBuilder` around) - rust-lang#122880 (Unix: Support more platforms with `preadv` and `pwritev`) - rust-lang#123038 (std library thread.rs: fix NetBSD code for ILP32 CPUs.) - rust-lang#123084 (`UnixStream`: override `read_buf`) - rust-lang#123102 (RustWrapper: update call for llvm/llvm-project@44d037cc258dcf179d2c48…) - rust-lang#123107 (Implement `Vec::pop_if`) - rust-lang#123118 (Update `RwLock` deadlock example to not use shadowing) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123038 - he32:netbsd-ilp32-fix, r=workingjubilee std library thread.rs: fix NetBSD code for ILP32 CPUs.
No description provided.