-
Notifications
You must be signed in to change notification settings - Fork 37
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
Use alignment hack to workaround luajit lightuserdata #243
Conversation
🤔 cqueues seem to be using that mask on various I also don't know if the mentioned "negative pointers" are realistic; they would cause problems
– not just for uniqueness but they would still be over 47 bits in the code as written ATM. |
Ah yep... I wonder if results from
ah right; we still need the mask. Another thought: we should mix the high bits into the low bits to preserve uniqueness if we use multiple methods. |
Uniqueness: if you shift by six bits and use a 47-bit mask, you'll get the "sign" bit in the most significant one. EDIT: so possibilities are there, but the overall space to cover might be a bit large. |
re: uniqueness I was thinking of if you ended up with e.g. 0x0000001234567800 as then they could collide. |
I didn't realize you want to avoid collisions with other values, too. |
So... we give this up in favor of LuaJIT/LuaJIT@e9af1abec54 ? |
ooo, yeah that sounds like a reasonable idea.... does it all work well? |
I haven't tried it yet, but on a quick look, the approach supports up to 256 37-bit segments, so that sounds like a nice compromise. |
Closing as LuaJIT/LuaJIT@e9af1abec54 is the real fix. We should remove the current 47bit hack code in the next release. |
Idea from #241 (comment)
@vcunat please review?