Re[2]: [Gc] weak maps and libgc

Ivan Maidanski ivmai at mail.ru
Wed Oct 26 01:18:44 PDT 2011


Hi Andy,

26 10 2011, 00:06 Andy Wingo <wingo at pobox.com>:
> Hi,
> 
> On Fri 21 Oct 2011 16:40, Ivan Maidanski <ivmai at mail.ru> writes:
> 
> > Could you please summarize your past writings about the
> > implementations difficulties?  Thanks.
> 
> More concretely, I would be happy if:
> 
>  (1) There were a variant of GC_register_disappearing_link that also
>      incremented an `unsigned long' somewhere in memory.  This would
>      allow me to keep an accurate count of how many items are in a weak
>      hash table, and remove my need to run something after GC.

You mean statistic counter, right?
Good idea.

> 
>  (2) There were a function to move disappearing links, perhaps callable
>      only within the alloc lock.
> 
>      I did some profiling today with the open-addressed table.  It has
>      to shuffle items around sometimes.  Unregistering then registering
>      disappearing links shows up pretty high on the profile.

Is my understanding correct - you want to optimize the following:

// assume GC_general_register_disappearing_link(&link, obj1);
...
GC_unregister_disappearing_link(&link);
GC_general_register_disappearing_link(&link, obj2);

Right? If yes, I don't mind again.

> 
>  (3) It would be nice if there were a callback after GC.  It would let
>      me accurately measure the time in GC, for example.  This isn't
>      relevant to the current discussion though.

What's about existing GC_set_start_callback?

> 
> What do you think?  I am happy to look at coding up these features, but
> I would like your input first.

Ok. My 'input' is above.

Regards.

> 
> Andy
> --
> http://wingolog.org/
> 



More information about the Gc mailing list