This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
GC questions.
- To: guile at sourceware dot cygnus dot com
- Subject: GC questions.
- From: Han-Wen Nienhuys <hanwen at cs dot uu dot nl>
- Date: Sun, 21 May 2000 16:02:37 +0200 (CEST)
- Reply-To: hanwen at cs dot uu dot nl
Hi list,
My mind has been wandering in GC land for a few days, and I decided to
have a look at gc.c (for educational purposes).
* I am puzzled by GUILE_NEW_GC_SCHEME. What is it? Why is it optional?
It makes reading gc.c a pain.
* Why does gc.c use malloc for getting more heap? Wouldn't it be
quicker/easier to skip malloc and do a mmap("/dev/zero") directly?
* The 2nd paragraph explanation for scm_[un]protect_object is
convoluted: there is no reference count, and the explanation does not
explain the complexity of protecting and unprotecting an object. I
would scrap the 2nd paragraph.
* I understood from Greg's notes, that one of the problems with
copying GC is how to deal with heap pointers in smobs? But isn't that
easy? To deal with this requires a small API change: every object has
to be marked during GC, so how about defining a new function
get_new_location (), like this?
struct smobstruct
{
SCM m1;
SCM m2;
};
mark_smob (SCM ptr)
{
smobstruct *sp = gh_cdr (ptr);
sp->m1 = scm_get_new_location (sp->m1);
sp->m2 = scm_get_new_location (sp->m2);
}
this breaks compatibility completely. It would be possible to fix this
up, by defining scm_gc_mark () to be an alias for the conservative
mark function.
--
Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter
http://www.cs.uu.nl/people/hanwen/lilypond/index.html