lua-users home
lua-l archive

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

>>>>> "Russell" == Russell Y Webb <> writes:

    Russell> The issue of garbage collectors is very interesting ---
    Russell> there are so many variations and trade-offs.

    Russell> Personally, I think the best (and most Lua-like) solution
    Russell> is to make the garbage collector completely modular with
    Russell> a published way to redefine it with appropriate hooks
    Russell> (many of which can be empty) to define most any scheme. [...]

I skipped most of Russell's (interesting) message 

Even if I do share this wish, I am not sure it is achievable in
practical terms.

For instance, if you wanted to use a generational copying GC in Lua
(which updates any pointer by copying live objects, and then free the
old region at once...) you'll have to

1. declare each object parameter and each object local variable

2. notify of each update within a Lua object.

(Lua objects here mean anything the GC has to take care of).

However, I do wish that Lua uses a different GC (or perhaps several
ones, configurable at compile-time), perhaps a generational copying

For people interested, I actually did implement a generational copying
GC for C which could perhaps be used in Lua. See for details.  You can
download the latest (unreleased) snapshot from

More generally, changing the GC may requires change to the C API of


email: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
8, rue de la Faïencerie, 92340 Bourg La Reine, France