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=2.6 required=5.0 tests=AWL,DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE,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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A7353BB84 for ; Fri, 31 Oct 2008 09:37:51 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcEAANhCknAXQImgWdsb2JhbACTUD4BARYirh2KOgEDAQODToIE X-IronPort-AV: E=Sophos;i="4.33,521,1220220000"; d="scan'208";a="19413330" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 31 Oct 2008 09:37:51 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m9V8boPO001426 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 31 Oct 2008 09:37:51 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjsBAE9gCklIDtyYimdsb2JhbACTUD4BAQEKCQwHDwWuIoo5AQMBA4NOggQ X-IronPort-AV: E=Sophos;i="4.33,521,1220220000"; d="scan'208";a="30963998" Received: from fg-out-1718.google.com ([72.14.220.152]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Oct 2008 09:37:50 +0100 Received: by fg-out-1718.google.com with SMTP id e21so879073fga.25 for ; Fri, 31 Oct 2008 01:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer:sender; bh=MD1WhK2VEg8X2djexh2rPzNhLELeb0FLY/iXckDiuWI=; b=YjVBrMBbF5dDZ++UFYqEL2NQ9E/WVn3tr869Q/0KYowWq7JkTHgUTFGy36d+RirxcH TSS1kN/j0wY4yVt18FPu+xrbDyaRIbdlzjk1bTCv74o2rnCIZPi96DIKzKXyuK/+uGlp 89rZzocjel+aZ9yOFnwKV2h32CiYay7m6b90U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer:sender; b=MLx8hb8wK0GZKdq5dcGf2GqahlF1YNc6BYskKjDab/9a7eCugK3i8bhQBCBoII7sOj rKVV3JhS7jgb4wKB6Ic5pGghLnGesAc9NWKv99OdBdOZqcFbAJCBhvW53UhQeW0fK0o9 j+o/0xgwJaPgVUYkcVo9+0S27S257ZrMuUs9E= Received: by 10.86.4.14 with SMTP id 14mr7994359fgd.76.1225442270396; Fri, 31 Oct 2008 01:37:50 -0700 (PDT) Received: from ?10.0.1.2? (152-2.2-85.cust.bluewin.ch [85.2.2.152]) by mx.google.com with ESMTPS id l12sm4069035fgb.6.2008.10.31.01.37.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Oct 2008 01:37:49 -0700 (PDT) Message-Id: <9E14E68C-5480-46B8-9426-11EE40B6B139@erratique.ch> From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= To: OCaml Mailing List In-Reply-To: <490A6A19.9050704@ens-lyon.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: [Caml-list] understanding weak Date: Fri, 31 Oct 2008 09:37:22 +0100 References: <490A6A19.9050704@ens-lyon.org> X-Mailer: Apple Mail (2.929.2) Sender: =?UTF-8?B?RGFuaWVsIELDvG56bGk=?= X-Miltered: at discorde with ID 490AC3DF.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bunzli:01 buenzli:01 ocaml's:01 pointers:01 pointers:01 hash:01 pointer:01 pointer:01 warren:98 wrote:01 caml-list:01 jambon:01 usefull:02 binding:02 daniel:04 Le 31 oct. 08 =E0 03:14, Martin Jambon a =E9crit : > Warren Harris wrote: >> I'd like to understand better how ocaml's weak pointers operate. =20 >> First, >> although it doesn't seem to be specified in the documentation, I =20 >> assume >> that weak pointers will *not* be reclaimed (e.g. from a weak hash =20 >> table) >> if the program retains some other reference to the object. I.e. the =20= >> weak >> pointer must be the last remaining pointer to the object for =20 >> reclamation >> to occur. > > Yes, otherwise the program would crash. No since Weak.get returns an option type. As written the documentation =20= sounds like the binding could disappear from the array even though the =20= program still has references to the value. This could be done, =20 wouldn't be usefull, but wouldn't crash the program. Daniel=