guile-devel
[Top][All Lists]
Advanced

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

Re: GUILE GC -- Write barrier for vectors


From: Han-Wen Nienhuys
Subject: Re: GUILE GC -- Write barrier for vectors
Date: Mon, 15 Jul 2002 20:22:19 +0200

address@hidden writes:
> > Also, smobs and maybe some other types (which ones? structs?), are
> > always assumed to have been changed, since they are outside of GC's
> > control. It would probably be best to allocate them from a different
> > pool so that they won't poison the normal generations, but that would
> > require a slight extension of the GUILE API.
> 
> Do you have a suggestion for such an extension?

        SCM scm_changing_cell()
        SCM scm_changing_vector()

They would be allocated from a separate memory pool. Also if we
redefine the GC engine to use a different function internally
(i.e. scm_gc_internal_mark), then we can distinguish between data
cells that may be moved (only pointed to from within the heap), and
other cells (marked by scm_gc_mark: conservatively marked entries,
pointed to from smobs, etc.).

The copiable cells could be subjected to copying GC, although it would
require another scan of the entire heap.

>I think, summarizing all thoughts in workbook will be quite helpful.

I much prefer comments in the  source code. If you're serious about
hacking that's the first place where you go looking anyways.

> > * Direct write access to a vector must be done through the macro
> > SCM_WRITABLE_VELTS.
> 
> Hmmm?  Where should this be necessary?  Do you want to modify the vector
> cell itself, or are you using this for "speed ups"?  In the "speed-up"
> case:  wouldn't SCM_VECTOR_SET do as well, given that the compiler can
> extract constant expressions from within loops?

In some cases no (GC manipulations of weak vectors), and in some cases
yes, but it would introduce lots of redtape: long lists of
SCM_VECTOR_SET calls. I'll review the cases once more. 

> > * Will this patch be integrated into CVS?  The FSF already has
> >   disclaimers for me.
> 
> I have not looked into the patch yet, but I think that the SCM_VECTOR_SET
> patch as you describe it is probably the right thing to do.  I am not sure
> about the need for SCM_WRITABLE_VELTS, but I think we can discuss this
> one.  In any case, it would be great if you could contact Michael Livshin.

I assume he is still on the list, reading all my musings? Also I
noticed that Greg Harvey did a lot of work on gengc, but apparently
that didn't work very well?


--
Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]