Skip to content
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

Add workaround for LuaJIT not supporting >47bit pointers #225

Merged
merged 1 commit into from
Jul 25, 2019

Conversation

daurnimator
Copy link
Collaborator

Cqueues mostly uses lightuserdata as unique keys.
It's hacky, but the best workaround seems to be just masking off the top bits.

Solves #223

@daurnimator
Copy link
Collaborator Author

Annoyingly, this makes building with LuaJIT different to building with plain Lua 5.1.
I wonder if distros would want to compile with CQS_USE_47BIT_LIGHTUSERDATA_HACK so that 5.1 and LuaJIT can share the library....

@vcunat

This comment has been minimized.

@vcunat
Copy link
Contributor

vcunat commented Jul 21, 2019

__arch64__ is a typo, most likely. EDIT: I replaced it with __aarch64__ for now, but I know little about these defines.

src/cqueues.h Outdated Show resolved Hide resolved
@vcunat
Copy link
Contributor

vcunat commented Jul 21, 2019

With these two changes I mentioned, it loads and passes some simple tests.

@daurnimator
Copy link
Collaborator Author

__arch64__ is a typo, most likely. EDIT: I replaced it with __aarch64__ for now, but I know little about these defines.

__arch64__ was intentional, it should be defined on 64 bit targets.

@daurnimator daurnimator force-pushed the luajit-47bit-pointer-hack branch 2 times, most recently from d4c8293 to 1e00a82 Compare July 21, 2019 09:46
@vcunat
Copy link
Contributor

vcunat commented Jul 21, 2019

OK, I don't know – for now I mainly cared for the define to get triggered.

I wanted to do some more testing, but I ran into the same problem in luaossl :-/

@daurnimator daurnimator merged commit 7702dc0 into wahern:master Jul 25, 2019
@daurnimator daurnimator deleted the luajit-47bit-pointer-hack branch July 25, 2019 07:35
@daurnimator
Copy link
Collaborator Author

@vcunat wahern/luaossl#173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants