[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Garbage collection
- From: Basile STARYNKEVITCH <basile@...>
- Date: Tue, 29 Oct 2002 19:23:13 +0100
>>>>> "Russell" == Russell Y Webb <rw20@cornell.edu> 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
GC.
For people interested, I actually did implement a generational copying
GC for C which could perhaps be used in Lua. See
http://starynkevitch.net/Basile/qishintro.html for details. You can
download the latest (unreleased) snapshot from
http://starynkevitch.net/Basile/qish-0.4pre5.tar.gz
More generally, changing the GC may requires change to the C API of
lua.
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net
alias: basile<at>tunes<dot>org
8, rue de la Faïencerie, 92340 Bourg La Reine, France