mlua-rs / rlua

High level Lua bindings to Rust
Other
1.73k stars 115 forks source link

add luajit support #271

Closed lazytiger closed 1 year ago

lazytiger commented 1 year ago

add system_luajit feature to support luajit2.1

jugglerchris commented 1 year ago

Thanks, this looks great! I'll take a closer look at the weekend, but I was wondering what the change in the allocation functions is for - is that just a difference in how LuaJIT is initialized?

lazytiger commented 1 year ago

Yes, Luajit has its own allocator, and lua_newstate is not allowed to be called directly, luaL_newstate is the only way now.

jugglerchris commented 1 year ago

Looks good to me, thanks! Would you mind running rustfmt? I think that's the only thing causing the CI builds to fail.

lazytiger commented 1 year ago

I have formatted the lua.rs but the bindgen issue arose, I can't figure out why.

jugglerchris commented 1 year ago

Thanks! I've merged - the bindgen errors are not related. For some reason the output from bindgen recently has become machine-dependent - I need to either fix it or make the checks laxer. I will aim to get a new release out after fixing that and adding a luajit CI job.

jugglerchris commented 1 year ago

I've just published 0.19.6 with the LuaJIT support. Thank you again!

lazytiger commented 1 year ago

You are too kind, I am glad to contribute to this repository, it's great.