From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 69B15BCAE for ; Sat, 25 Jun 2005 13:10:43 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5PBAgHs025745 for ; Sat, 25 Jun 2005 13:10:42 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA00761 for ; Sat, 25 Jun 2005 13:10:42 +0200 (MET DST) Received: from cantina.students.cs.unibo.it (cantina.students.cs.unibo.it [130.136.3.110]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5PBAfwc020278 for ; Sat, 25 Jun 2005 13:10:42 +0200 Received: from fistandantilus.takhisis.org (cantina.students.cs.unibo.it [130.136.3.110]) by cantina.students.cs.unibo.it (Postfix) with ESMTP id 52A8BBF7F; Sat, 25 Jun 2005 13:10:41 +0200 (CEST) Received: by fistandantilus.takhisis.org (Postfix, from userid 3148) id 045D0274041; Sat, 25 Jun 2005 13:10:39 +0200 (CEST) Date: Sat, 25 Jun 2005 13:10:39 +0200 From: Stefano Zacchiroli To: Inria Ocaml Mailing List Cc: Pietro Abate Subject: Re: [Caml-list] simulate class destructor Message-ID: <20050625111039.GA1420@fistandantilus.takhisis.org> Mail-Followup-To: Inria Ocaml Mailing List , Pietro Abate References: <20050625095207.GA597@pulp.anu.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050625095207.GA597@pulp.anu.edu.au> User-Agent: Mutt/1.5.9i X-Miltered: at nez-perce with ID 42BD3BB2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42BD3BB1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; zacchiroli:01 caml-list:01 simulate:01 simulate:01 zacchiroli:01 unibo:01 25,:98 ...:98 zack:01 zack:01 wrote:01 debian:02 module:03 finalise:04 i'd:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On Sat, Jun 25, 2005 at 07:52:07PM +1000, Pietro Abate wrote: > Is it possible to simulate class destructor, that is convince Gc to call > a method before deallocating the object ? I'd like to take a closer look > at what's happening in my program to check if everything works at it > should... I've a NodeCounter module with a counter that increase every > time I create a new object, now I'd like to decrement the counter when > the object is de-allocated. Impossible ? Gc.finalise -- Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/ If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. -!-