lua-users home
lua-l archive

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


> Well, sure, but the whole point was to (a) avoid the registry, and
> (b) reduce the execution overhead. It is a simple pointer offset to
> convert from the userdata block address to the userdata object. A
> supported lua_pushuserdata (or something like that) would save lots
> complexity compared with using the registry, and avoid use of ad hoc
> undocumented mechanisms.

That would create a whole new world of possibilities for dangling
pointers. Lua has a strong principle of avoiding references that
are not accounted for by the garbage collector.

-- Roberto