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
Memory statistics tool
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-24 (12:48)
From: Dr. Thomas Fischbacher <t.fischbacher@s...>
Subject: Re: [Caml-list] Memory statistics tool
Alain Frisch wrote:

>>Many thanks! I just had a glance at it, but it seems to be just how one
>>would have to approach such a problem. (The issue with hash-based
>>approaches to find previously visited substructures is that during
>>traversal, a GC may occur. Now I just assume that this may involve
>>relocation and heap compaction in OCaml. The problem then is that
>>OCaml does not properly support what would be known as eq hash tables
>>in Lisp.)
> As long as the data structure supports the polymorphic hash function, it
> should work to simply use a regular hash table with the polymorphic hash
> function and physical equality, as in:
> module S = Hashtbl.Make(struct
>    type t = Obj.t
>    let hash = Hashtbl.hash
>    let equal = (==)
> end);;

Why? (I.e. I'm not convinced yet.)

best regards,
Thomas Fischbacher