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
[Caml-list] GC and preventing data relocation
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-21 (00:01)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] GC and preventing data relocation
On Thu, 20 Mar 2003, Christopher Quinn wrote:
> i looked into this and came up with:
> a) if you have C-heap struct specific to each invocation, register the 
> field holding the string pointer as a caml root, deregister it on 
> completion. but that is more overhead.

I don't quite understand this solution. How should this prevent the
string from being relocated if the string was allocated in the OCaml-heap?

> b) add a CString_tag to the set of value tags, modify the compactor() 
> routine to take acccount of it, and change the tag of a regular string 
> at runtime.
> unfortunately this scheme greatly inconveniences the design of the 
> compactor and would likely slow it down.

And wouldn't be particulary portable...

> c) differentiate static from dynamic 'chunks' and allocate strings 
> from static chunks. this still allows GC to be done on static values 
> but is easily integrated into the compactor.
> interface: val Cstring.make: int -> string ... as normal.
> i have a patch for this if you are interested.

This solution is also not portable and inconvenient for the user,
because he has to allocate strings in this specific way.

Hm, seems we are out of luck here?

Markus Mottl

Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners