-
Notifications
You must be signed in to change notification settings - Fork 48
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
manual bitfield in TermList
to improve portability
#524
Conversation
While having a look, does this help fixing #512 ? |
Probably not directly - there seems to be something wrong on PowerPC even if you fix the bitfield layout "manually", but it won't make it worse. |
I think I actually like this! Looks quite robust at a careful glance! I am just tempted to suggest a "@joe-hauns"-style trick to create a macro which expands to create both the getter and the setter. Maybe that's too evil. But, on the other hand, if this solution is a bit fragile than it's because of the loose-ish connection between the |
52318ca
to
696e231
Compare
Your wish is my command! Coming up. |
I was hopeful to also macro-ify the bitfield layout itself, but you can't recursively call macros so that got messy. If you're happy, go ahead and merge. |
Thank you. I went one step further. Is that OK? |
Yes! I missed that completely, sorry. |
In
TermList
we use a bitfield for some metadata, which for pointer-tagging reasons we really need not to shift around: this could happen by the compiler either inserting padding or by moving members around. This has worked so far, but the standard doesn't say that it will continue to work. In #512 we see that indeed it doesn't work on some architectures.As I'm not aware of a better way to do it, I have implemented manual bit-twiddling to replace the current bitfield. I have attempted to make this as safe/portable as possible.