Saptarshi Guha wrote: > I hope i haven't missed this, but does the C function lua_type return 10 > for cdata objects? Is there #define for this (e.g. like LUA_TCDATA) Only internally. But, yes, it's guaranteed to be 10 for LuaJIT 2.0. > Or is there another better way to check whether a lua object is a CDATA. No, because the classic Lua/C API and the FFI shouldn't be mixed. Deal with cdata on the Lua side only. Call C functions that need to be passed cdata only via the FFI. --Mike