From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7D951BB9C for ; Thu, 17 Nov 2005 02:44:43 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAH1igit010650 for ; Thu, 17 Nov 2005 02:44:42 +0100 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 CAA04736 for ; Thu, 17 Nov 2005 02:44:41 +0100 (MET) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAH1ifts006271 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 17 Nov 2005 02:44:41 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EcYnh-0002K8-3j for caml-list@inria.fr; Thu, 17 Nov 2005 02:42:57 +0100 Received: from 67.71.33.38 ([67.71.33.38]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Nov 2005 02:42:57 +0100 Received: from monnier by 67.71.33.38 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Nov 2005 02:42:57 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Stefan Monnier Subject: Re: Finalization and object dependencies Date: Wed, 16 Nov 2005 20:42:20 -0500 Message-ID: <873blwf3yt.fsf-monnier+gmane.comp.lang.caml.inria@gnu.org> References: <878xvv1c2n.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 67.71.33.38 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:I9R2gRHIff8uWp87oZl+gR5kQ0c= Sender: news X-Miltered: at concorde with ID 437BE08A.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 437BE089.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; umontreal:01 dependencies:01 silently:01 finalizers:01 stderr:01 syslog:01 exception:01 finalization:01 library:03 crashes:03 leaks:04 gracefully:05 table:93 table:93 memory:08 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=RCVD_BY_IP,RCVD_NUMERIC_HELO autolearn=disabled version=3.0.3 > Usually, application code will gracefully close all cursors, and the > table, but I want my library to be as safe as possible to use, and > avoid random crashes or memory leaks. I recommend to consider it an error if the table (and cursors) were not properly closed. So instead of hiding the error (by silently closing tables from finalizers), I recommend you signal an exception or at least log some warning to stderr or syslog or something. Stefan