This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GC questions.




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 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]