Re: [Gc]: Heap traversal

Ivan Maidanski ivmai at mail.ru
Mon Oct 19 22:16:01 PDT 2009


Hi!
ludo at gnu.org (Ludovic CourtХs) wrote:
> Hello,

Hans -
could you also answer this post (just not to have it in a backlog)?

> 
> The former GC of Guile provided information about the (approximate)
> number of live objects of each data type:
> 
> --8<---------------cut here---------------start------------->8---
> guile> (pp (gc-live-object-stats))
> (("dynamic-state" . 2)
>  ("complex number" . 7)
>  ("thread" . 1)
>  ("frame" . 19)
>  ("macro" . 72)
>  ("srcprops" . 2898)
> 
> [...]
> 
>  ("cons (non-immediate car)" . 41614)
>  ("jmpbuffer" . 1))
> --8<---------------cut here---------------end--------------->8---
> 
> With libgc, heap traversal can be done with  GC_apply_to_all_blocks?()'.
> This is what GCJ does
> (http://google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#nnPz_KYt5WI/com/avtrex/test/memory/GCInfoC.cc&q=GC_enumerator&l=264).
> 
> The problem is that  GC_apply_to_all_blocks?()',  struct hblk', and the
> macros and functions that manipulate blocks and block headers are all
> private.
> 
> What would be the best way to expose just enough of these internals so
> that one can write this kind of heap traversing code?
> 
> Thanks,
> Ludo'.

Bye.


More information about the Gc mailing list