I know there are examples of creating pointers using the LuaJIT FFI, but most of these aren\'t pointed to existing data. One such example of this is here: How to pass a poin
There's no way to get a pointer to a cdata object in the FFI.
I remember reading in the LuaJIT mailing list that this was done intentionally for some optimizations to work, though I can't find the exact message in the archive.
So far, I haven't had a need for getting the pointer of a cdata object; LuaJIT refers to cdata by reference (similar to tables) and the type[1] trick works for out parameters.