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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 42589BC4E for ; Mon, 4 Sep 2006 16:14:57 +0200 (CEST) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k84EEqxs002941 for ; Mon, 4 Sep 2006 16:14:57 +0200 Received: from [10.1.0.20] (unknown [10.1.0.20]) by mail.barettadeit.com (Postfix) with ESMTP id 0377250E5; Mon, 4 Sep 2006 16:19:00 +0200 (CEST) Message-ID: <44FC34B0.1000704@studio.baretta.com> Date: Mon, 04 Sep 2006 16:14:08 +0200 From: Alessandro Baretta User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: Remi Vanicat Cc: Ocaml Subject: Hweak question Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 44FC34DC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 pointer:01 hashtable:01 hashtables:01 pointer:01 hastables:01 functor:01 bindings:01 ingegneria:98 headquarters:98 garbage:01 alessandro:03 alessandro:03 vanilla:03 While googling for weak pointer resources, I have discovered the beautiful Hweak library, implementing a real weak hashtable. I should have googled for it a long time ago. Just one question: how do you manage to maintain the bound value live when the key is live? As far as I know from experimenting with the weak hashtables in the vanilla distribution it is enough for the pointer to the bound value to become unreachable for it be garbage collected away. I tried implementating weak hastables on top of the weak "hashed set" functor of the standard library but never managed to get the GC to keep my bindings live so long as the the key was live. Alex -- ********************************************************************* Ing. Alessandro Baretta Studio Baretta http://studio.baretta.com/ Consulenza Tecnologica e Ingegneria Industriale Technological Consulting and Industrial Engineering Headquarters tel. +39 02 370 111 55 fax. +39 02 370 111 54 Lab tel. +39 02 9880 271 fax. +39 02 9828 0296