From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA06221; Thu, 1 Apr 2004 06:48:52 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA05745 for ; Thu, 1 Apr 2004 06:48:51 +0200 (MET DST) Received: from xanadu.ece.ucsb.edu (xanadu.ece.ucsb.edu [128.111.56.51]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i314nYjq001765 for ; Thu, 1 Apr 2004 06:49:35 +0200 Received: from [12.107.11.68] (cbshost-12-107-11-68.sbcox.net [12.107.11.68]) by xanadu.ece.ucsb.edu (8.12.10/8.12.10) with ESMTP id i314mjeO025420 for ; Wed, 31 Mar 2004 20:48:46 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v613) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list@inria.fr From: Shivkumar Chandrasekaran Subject: [Caml-list] Weak pointers and Gc.finalise Date: Wed, 31 Mar 2004 20:48:45 -0800 X-Mailer: Apple Mail (2.613) X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shivkumar:01 shiv:01 pointers:01 marshaling:01 --shiv--:01 bigarray:01 bigarray:01 inefficient:01 behaviour:01 marshal:01 finalisation:02 finalisation:02 necessarily:02 pointer:03 ece:96 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 5 I just noticed that if the only reference to a bigarray is in a Weak.t array, and if there is a finalisation function set on the bigarray, then that finalisation function is not necessarily called when the entry in the Weak.t array is set to None. Rather it is potentially called *much* later. I am assuming that this is the right behaviour. My question is, can I get the finalisation function to be called when the weak pointer is being set to None? (Side note: I am trying to avoid Marshaling the Bigarray unless it is going to be garbage-collected. But if I cannot detect that, then I have to always Marshal it whenever its entries change, which is very inefficient.) Thanks, --shiv-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners