Skip to content

feature: implemented the luaL_checkcdataptr C API for converting LuaJIT cdata pointer object on Lua stack to pointer. #74

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
wants to merge 2 commits into from

Conversation

dndx
Copy link
Member

@dndx dndx commented Sep 14, 2019

Right now LuaJIT does not expose any C API for C code to unwrap boxed cdata objects from the stack. This API adds support for unwrapping pointer type cdata objects.

@agentzh
Copy link
Member

agentzh commented Sep 14, 2019

Why do we need this? Any concrete use cases? The cdata type is designed to be used with FFI, not the traditional Lua C API context.

@dndx
Copy link
Member Author

dndx commented Sep 14, 2019

@agentzh
Copy link
Member

agentzh commented Sep 17, 2019

Hmm, that looks more like a hack since we lose the type information of the incoming cdata arguments. I think the right way is to re-implement the sslhandshake method as a pure FFI-based one instead (or better, the whole cosocket API). I don't feel comfortable at all with adding this C function to the existing LuaJIT ABI.

@dndx
Copy link
Member Author

dndx commented Sep 19, 2019

Superseded by: openresty/lua-nginx-module#1602.

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.

2 participants