Skip to content

Allow unsafe direct access to Lua state #209

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

Closed
jugglerchris opened this issue Jul 4, 2021 · 1 comment
Closed

Allow unsafe direct access to Lua state #209

jugglerchris opened this issue Jul 4, 2021 · 1 comment
Milestone

Comments

@jugglerchris
Copy link
Collaborator

We should:

  • Add a way to get an ffi::lua_State pointer from an existing Lua.
  • Add a way to construct a Lua from an externally created ffi::lua_State

Both should be unsafe in the Rust sense.

As part of this we also need to:

  • Document what is safe or not
  • Stop using the Lua "extra data" (from lua_getextraspace())

See #137 for some discussion.

@khvzak
Copy link
Member

khvzak commented Feb 6, 2024

This feature is supported by mlua, see Lua::create_c_function to get access to raw lua_State. mlua-sys can be used to utilize raw C api in mlua.

Lua::init_from_ptr can be used to create mlua instance from a raw state.

@khvzak khvzak closed this as completed Feb 6, 2024
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

No branches or pull requests

2 participants