lua-users home
lua-l archive

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


On Sun, May 3, 2015 at 4:39 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
>> PS 2. Why no individual metatables for light userdata?
> They would no longer be light. A light userdata is like a number:
> it's just a pointer.
Light userdata's advantage over normal userdata is being a number in
context of table's key. In other words two light userdata pointing the
same memory (sharing the same address) are *one* key in a table.
Normal userdata with values of pointers are two keys in a table. The
only workaround I know is using table, mapping light userdata to
normal userdata with same value.


-- 


Best regards,
Boris Nagaev