-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
[Question]Why luajit feature not support memory_limit #119
Comments
It's quite interesting question. Mostly because In Lua 5.1/JIT lua_pushcfunction api call can trigger memory errors. Our protection mechanism to intercept Lua exceptions heavy relies on resilient Unfortunately I don't see a simple way how to enable memory limits in Lua 5.1/JIT 🤔 |
Thank you for your reply. It's a little complicated for me, maybe I should use unsafe rust to call luajit c api directly😢 |
it does not matter actually, you would get crash unless wrap it to |
Other versions already support this feature. Closes #119
I believe I found a good workaround, so memory limits will be supported for any Lua in v0.9 |
Related code:
https://github.com/khvzak/mlua/blob/cfb5d3fd45a810e5cde6811b039d154241d1444c/src/lua.rs#L332-L399
fn allocator
include luajit feature, but it is not used when new lua state.The text was updated successfully, but these errors were encountered: