Skip to content

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

Closed
dndx wants to merge 2 commits into
openresty:v2.1-agentzhfrom
dndx:feat/check_cdata
Closed

feature: implemented the luaL_checkcdataptr C API for converting LuaJIT cdata pointer object on Lua stack to pointer.#74
dndx wants to merge 2 commits into
openresty:v2.1-agentzhfrom
dndx:feat/check_cdata

Conversation

@dndx

@dndx dndx commented Sep 14, 2019

Copy link
Copy Markdown
Member

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

agentzh commented Sep 14, 2019

Copy link
Copy Markdown
Member

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

dndx commented Sep 14, 2019

Copy link
Copy Markdown
Member Author

@agentzh

agentzh commented Sep 17, 2019

Copy link
Copy Markdown
Member

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

dndx commented Sep 19, 2019

Copy link
Copy Markdown
Member Author

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