Subject: Re: bug#24695: impossible to use weak hash tables inside gc hooks

From: Andy Wingo <[email-masked]>
Date: Wed, 01 Mar 2017 13:49:53 +0100

On Fri 14 Oct 2016 20:54, Stefan Israelsson Tampe <[email-masked]> writes:

> For more advanced gc concepts it would be nice to keep a set a objects
> in a weak key hash table and at gc loop over the alive ones the
> various gc hooks that is available for the c
> coder.
>
> The problem is that current guile data structure would hang on folding
> because inside the guile weak folder gc is assumed to be
> prevented. Not sure what to do here. This might be a
> feature request or a bug report dependning on how you view it.

What does "at GC" mean?  After GC?  Before GC is a pretty tense
situation as you can't allocate memory.  Also I suspect you could do
this with a weak vector (or other structure with disappearing links) and
a before_gc C hook.  WDYT?

I am tempted to just close this one as out of scope for Guile :)

Andy