lua-users home
lua-l archive

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

On Tue, 18 Sep 2001, Jack Palevich wrote:

> Both of these ideas require adding some code to the Lua interpreter
> everywhere a pointer to a heap object is written to. For reference counting
> you have to update the reference counts, for incremental garbage collection
> you have to update the list of items to be scanned. >

> That brings me to the issue of how best to modify the Lua sources to
> conduct the experiments. Since I'm just doing this on an experimental
> basis, I'm thinking that the easiest way to do this would be to compile the
> Lua sources using a C++ compiler, and then use smart pointer classes. That
> would make it easy to make sure I modify all writes to pointers to
> heap-based-objects. >

In Lua 4.1, all assignments to Lua objects are done through macros (or
should be). It should be possible to implement reference counting just by
redefining those macros.

-- Roberto