From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3C8E8BBAF for ; Thu, 24 Jul 2008 14:48:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKYWiEjAXQIn/2dsb2JhbACxVQ X-IronPort-AV: E=Sophos;i="4.31,246,1215381600"; d="scan'208";a="13416143" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jul 2008 14:48:39 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m6OCmcLG006620 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 24 Jul 2008 14:48:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucAAGgWiEiYToBqhWdsb2JhbACSUwEBAQoECQcRBZ5I X-IronPort-AV: E=Sophos;i="4.31,246,1215381600"; d="scan'208";a="15453898" Received: from mailgate5.iss.soton.ac.uk ([152.78.128.106]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Jul 2008 14:48:38 +0200 Received: from [152.78.96.56] (alpha.kk.soton.ac.uk [152.78.96.56]) (authenticated bits=0) by mailgate5.iss.soton.ac.uk (8.13.8/8.13.4) with ESMTP id m6OCmNgs018561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jul 2008 13:48:23 +0100 Message-ID: <48887A16.1070906@soton.ac.uk> Date: Thu, 24 Jul 2008 13:48:22 +0100 From: "Dr. Thomas Fischbacher" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060607 Debian/1.7.12-1.2 X-Accept-Language: en MIME-Version: 1.0 To: Alain Frisch Cc: dmitry grebeniuk , "caml-list@inria.fr" Subject: Re: [Caml-list] Memory statistics tool References: <48870DD8.4050906@soton.ac.uk> <1497034692.20080723154431@moldavcable.com> <48872D6E.20209@soton.ac.uk> <48872F38.30609@frisch.fr> In-Reply-To: <48872F38.30609@frisch.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mailgate5.iss.soton.ac.uk [152.78.128.106]); Thu, 24 Jul 2008 13:48:30 +0100 (BST) X-ISS-MailScanner-Information: Please contact Serviceline@soton.ac.uk for more information X-ISS-MailScanner: Found to be clean X-ISS-MailScanner-SpamCheck: X-Miltered: at concorde with ID 48887A26.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 compaction:01 ocaml:01 ocaml:01 hash:01 hash:01 hashtbl:01 struct:01 hashtbl:01 equality:01 polymorphic:01 polymorphic:01 wrote:01 heap:01 caml-list:01 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 t.fischbacher@soton.ac.uk