English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] How does OCaml update references when values are moved by the GC?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-10-30 (17:16)
From: Jon Harrop <jonathandeanharrop@g...>
Subject: RE: [Caml-list] How does OCaml update references when values are moved by the GC?
I was hoping for a little more detail, of course. :-)

How is the mapping from old to new pointers stored? Does the GC rewrite all
of the thread-local stacks in series before allowing any of them to
continue? Does the write barrier record pointers written into the major heap
so only those specific locations are rewritten at minor heap collections but
the entire major heap is rewritten upon compaction? Can the GC distinguish
between an array of ints and an array of pointers at run-time in order to
avoid traversing all of the ints when trying to rewrite pointers?

Also, any idea what the maximum proportion of the running time of a program
is spent doing this rewriting? For example, if you fill a float->float hash
table with values does updating the pointers in the major heap account for a
significant proportion of the total running time of the program?


> -----Original Message-----
> From: caml-list-bounces@yquem.inria.fr [mailto:caml-list-
> bounces@yquem.inria.fr] On Behalf Of Damien Doligez
> Sent: 29 October 2010 08:48
> To: caml users
> Subject: Re: [Caml-list] How does OCaml update references when values
> are moved by the GC?
> On 2010-10-28, at 23:48, Jon Harrop wrote:
> > How does OCaml update references in the stacks and heap when values
> are
> > moved by the GC?
> They are updated by the GC, of course.
> -- Damien
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs