lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Jun 9, 2013 at 11:58 AM, Wesley Smith <wesley.hoke@gmail.com> wrote:
>>> Instead of "light userdata" maybe "typeless user pointer" would be a
>>> clearer term.
>>
>> Or "pointless user type".
>
>
> It's quite useful in LuaJIT where you can cast pointers/lightuserdata
> to cdata types.
>

Even without LuaJIT I use lightuserdata fairly frequently as an opaque
handle type when Lua is accessing -- but not OWNING -- a C-side data
structure. The C-side code is responsible for informing the Lua-side
code when the object has been destroyed.


/s/ Adam