[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: light userdata (Was: Fastest way to transfer data from C to Lua ?)
- From: Coda Highland <chighland@...>
- Date: Sun, 9 Jun 2013 20:37:48 -0700
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