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

ctable: fix power-of-2 issue #1360

Conversation

alexandergall
Copy link
Contributor

I have brought this up in issue #1207, which is still open. I propose this fix at least as an interim solution until RaptorJIT lands (provided it will contain the fix proposed by @lukego).

Removal of two tail-call optimizations is also part of this PR. I found that this reduces trace aborts in my ipfix app some time ago. I'm not sure if we have converged on a common strategy to deal with this sort of problem, so this could be debatable.

LuaJIT dislikes pointer subtractions when the size of the pointed-to
objects is not a power of two, which leads to trace aborts. ctable
suffers from this problem. The patch pads the cdata type used as entry
for the table to the next power of two.

We also disable tail-call optimization for functions that end with a
call to a built-in, which also causes trace aborts in certain cases.
@alexandergall
Copy link
Contributor Author

Making this optional is probably not a good idea.

@alexandergall alexandergall deleted the ctable-fix-non-power-of-2-size branch June 21, 2018 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant