This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: generational GC
Lars Arvestad <arve@nada.kth.se> writes:
> It seems reasonable to me to say that gh_ provides a GC safe API,
> while you have to tinker and think for yourself to make GC work if
> you use SCM_.
Still, making write-barrier be the default increases
backward-compatibility: SCM_SETCAR won't break, for example.
> However, I do not see (probably because I have not looked into
> generational GC yet) how there can be a compromise. Either your code
> is GC safe or not, and in the latter case you will be bitten sooner or
> later, no?
1. SCM_DIRECT_SETCAR (x, SCM_MAKINUM (3))
(no write barrier necessary because we're working with immediates)
2. We might want to treat a bunch of values collectively instead of
working the write-barrier individually for every element.
3. We might be allocating new Scheme object. Therefore we know that
it belongs to the new generation => no barrier necessary (I think;
haven't dealt with this for a while)
Since we need the write barrier in all cases except when there are
special conditions such as 1-3, it seems reasonably that the default
is write-barrier and that we indicate the special situation where we
don't need it with an extra symbol in the name.