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 (16:12)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] Memory statistics tool
Dr. Thomas Fischbacher wrote:
> The OCaml manual gives no guarantee that Hashtbl.hash does not cons, so
> I cannot assume this.

Indeed, Hashtbl.hash can cons, but this does not contradict my point: 
its result does not depend on the physical location of objects in memory
(if it did, it would be impossible to use this function at all).

> Now, without that guarantee, there is a nasty race
> condition in which the determination of the hash bucket causes objects
> to move in memory.

Yes, objects can move in memory, but what is wrong with that? Their new 
hash value will remain the same.

-- Alain