Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] Memory statistics tool
Dr. Thomas Fischbacher wrote:
> Alain Frisch wrote:
>> 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.)

The two functions (hash and equal) are invariant w.r.t. changes of 
physical memory location of their arguments.

-- Alain