From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 772F0BB91 for ; Sun, 24 Jul 2005 01:27:44 +0200 (CEST) Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [213.186.42.179]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6NNRiUL031139 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 24 Jul 2005 01:27:44 +0200 Received: (qmail 5498 invoked by uid 503); 23 Jul 2005 23:27:46 -0000 Received: (QMFILT: 1.0); 23 Jul 2005 23:27:46 -0000 Received: from b6.ovh.net (HELO mail150.ha.ovh.net) (213.186.33.56) by 26.mail-out.ovh.net with DES-CBC3-SHA encrypted SMTP; 23 Jul 2005 23:27:46 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 23 Jul 2005 23:27:47 -0000 Received: from mail150.ha.ovh.net (10.0.50.150) by mail150.ha.ovh.net with SMTP; 23 Jul 2005 23:27:45 -0000 Received: from b0.ovh.net (HELO queue-pre) (213.186.33.50) by b0.ovh.net with SMTP; 23 Jul 2005 23:27:45 -0000 Received: from adsl-69-224-223-110.dsl.scrm01.pacbell.net (HELO trantor.glondu.net) (postmaster%glondu.net@69.224.223.110) by ns0.ovh.net with SMTP; 23 Jul 2005 23:27:45 -0000 From: Stephane Glondu Organization: Crans To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to do this properly with OCaml? Date: Sat, 23 Jul 2005 16:27:36 -0700 User-Agent: KMail/1.7.1 Cc: Thomas Fischbacher References: <200507231250.45778.Stephane.Glondu@crans.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507231627.37325.Stephane.Glondu@crans.org> X-Ovh-Remote: 69.224.223.110 (adsl-69-224-223-110.dsl.scrm01.pacbell.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Miltered: at nez-perce with ID 42E2D270.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 heap:01 bookkeeping:01 ...:98 ...:98 wrote:01 allocated:03 entries:05 uses:06 stephane:07 stephane:07 memory:08 2005:89 entry:10 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Saturday 23 July 2005 12:59, Thomas Fischbacher wrote: > I think that this will not work. > > If I duplicate entries to fill up holes, and later on remove a > legitimate entry whose duplicates fill holes from the heap, I have to > introduce extra bookkeeping so that the other placeholder copies of that > entry are replaced as well - otherwise it could not be reclaimed by GC. Oh, you are right, I didn't think about it... However, my first idea was to use always the same value to fill the holes (e.g. the first one given), so that you keep only this one allocated. Still, it won't be a good deal if your first value uses a lot of memory... Stephane Glondu.