lua-users home
lua-l archive

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

> Each time I have begun a project using lightuserdata, I eventually
> switched to full userdata. I found the automatic management of an
> object's lifetime outweighed the small time+space penalty for creation
> of a full userdata. I suppose we cannot remove lightuserdata completely. :)

Light userdata was introduced in the language with the only purpose
of allowing programs to map C pointers back to their respective full
userdata, using light userdata as keys in a table. (Until Lua 4.0
the API did that automatically.) It was not intended to be a "cheap"
replacement for full userdata.

-- Roberto