-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Update signal_handler, removing bitflags #967
Update signal_handler, removing bitflags #967
Conversation
Regarding the set of exception vectors, it's purposefully not an enum because we want to be able to specify a union of multiple variants at the same time, mostly for the purpose of registering a single handler that covers multiple distinct exception variants. While I know that code isn't used yet, that's why we used bitflags there. In fact, the only time we prefer bitflags is in this kind of scenario where we want to allow multiple variants to be selectable using only the space of a single primitive type, e.g., In general, I'm excited to experiment with |
Well I can change it to use a struct with bools instead, just didn't seem like the right thing to do |
Do you mean a struct of bools that uses bilge (or another crate) for bitpacking? Because a regular struct of bools would be much larger -- at one byte per bool, that's 32 bytes instead of 32 bits. That's also another reason why we use bitflags, to pack a lot of booleans into a small space. |
Edit: yes, I mean a bilge struct, which is bitpacked |
Ah i see, ok that does make sense. For this PR, I think it's best to accept it with just the |
Please look at #963. It lists all places with bitfiddle/field/flags, some of those are just tiny changes or notes, though. |
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.
Thanks!
First I wanted to change that piece of code to use bilge, but I'm not even sure why this wasn't an enum in the first case.
It's just some commented out code, btw.
Also using
variant_count
.#963