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

Support lua_pushcclosure #3

Open
SoniEx2 opened this issue Nov 28, 2017 · 1 comment
Open

Support lua_pushcclosure #3

SoniEx2 opened this issue Nov 28, 2017 · 1 comment
Assignees

Comments

@SoniEx2
Copy link

SoniEx2 commented Nov 28, 2017

lua_pushcclosure should push the parent lua_State as the first upvalue and a "function specifier" as the second upvalue.

the passed lua function should go on the parent lua_State's registry, and that's where the "function specifier" comes from.

lua_pushcclosure(function(L)
  print(L)
  print("virtualization!")
  return 0
end)

debug.* API wouldn't get much from those C closures, making this an effective sandbox.

@tylerneylon
Copy link
Owner

This general idea makes sense to me. I'll add it to my todo list and hopefully get to that soon. Thanks!

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

No branches or pull requests

2 participants