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 JAA30715; Mon, 29 Dec 2003 09:26:26 +0100 (MET) 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 JAA19262 for ; Mon, 29 Dec 2003 09:26:25 +0100 (MET) Received: from smtp1.pp.htv.fi (smtp1.pp.htv.fi [212.90.64.119]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBT8QOv27848 for ; Mon, 29 Dec 2003 09:26:24 +0100 (MET) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp1.pp.htv.fi (Postfix) with ESMTP id CB1097FE6C for ; Mon, 29 Dec 2003 10:26:23 +0200 (EET) Received: from oro (aka.pp.htv.fi [213.243.183.115]) by posti.pp.htv.fi (8.11.1 (Revision 1.5+JAGae91741+JAGae92668) /8.11.1) with ESMTP id hBT8QGT03084 for ; Mon, 29 Dec 2003 10:26:20 +0200 (EET) Received: from naked by oro with local (Exim 3.36 #1 (Debian)) id 1Aasiu-0008Gx-00 for ; Mon, 29 Dec 2003 10:26:00 +0200 To: caml-list@inria.fr Subject: [Caml-list] Modifying heap from custom finalizers? From: Nuutti Kotivuori Date: Mon, 29 Dec 2003 10:25:59 +0200 Message-ID: <878ykwni7c.fsf@naked.iki.fi> User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Loop: caml-list@inria.fr X-Spam: no; 0.00; finalizers:01 deed:99 finalizer:01 finalizers:01 reclaimed:01 caml:01 garbage:01 garbage:01 collector:02 collector:02 unit:03 heap:03 heap:03 pointed:04 pointed:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I am wonder how evil of a deed would I be doing to the garbage collector by modifying the heap in the finalizer of a custom block. Apparently the finalizers are run during the sweep phase of the major garbage collector. If I there change a value from the global table to the unit value - I think the worst I can make happen is that the value pointed by it does not get reclaimed in the same garbage collection cycle. But, what about anything more? Assigning values? Creating new values? Do I have to make sure the small heap stays empty? And if zeroing the value at sweep phase makes the values pointed by it garbage collected only at the next collection, is there any I can speed up the process? I could find no documentation what you can and what you can't do in the finalizers for custom blocks. TIA, -- Naked ------------------- 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