This is the mail archive of the guile@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]

Re: Scheme style auto-resizing hashtable (fwd)


> > It certainly can. I even think Guile's GC will interrupt long running
> > C operations that manipulate Scheme data.

Every call to cons can potentially trigger collection,
same with scm_must_malloc().

> but it can't possibly start GC'ing parts of the list; how could it
> possibly know which parts of the list are no longer needed?

You must write your C code so that it doesn't keep any memory
of where the start of the list is, i.e. it only keeps a SCM value
for what it has left to process. That way you leave your code no
possible way to go back to the start of the list and the stack
scanner figures this out. As soon as you have any variable holding
the start of the list, the GC can't do a thing -- even if you
have long ago finished with the contents of that variable.
The result may be that you need bogus assignments of SCM_BOOL_F
just as a way of proving that you don't use those values anymore.

	- Tel