lua-users home
lua-l archive

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


On Thu, 31 Jan 2002, J. Perkins wrote:

> If you'll accept my $0.02, the current implementation of
> ref/unref seems a big hack. The ability to associate C and
> script objects is an awfully important feature for an
> embedded language, but the current method (indices into
> the registry) seems an afterthought. At the very least, a
> dedicated table should be set aside for refs, freeing the
> registry for application use, and support re-added for
> unlocked refs.

In the work version, the old ref/unref are just macros that use
luaL_ref, luaL_unref, and lua_rawgeti over the registry. These functions
can operate over any table. So, it is trivial to put your references in
your own dedicated table (which can be weak).

-- Roberto