[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strange userdata metatable behavior in C API
- From: roberto@... (Roberto Ierusalimschy)
- Date: Mon, 4 Jun 2007 12:55:01 -0300
> 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.