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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 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 31445BC6B for ; Mon, 10 Dec 2007 22:05:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGE4XUfAXQInh2dsb2JhbACPZQEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.24,148,1196636400"; d="scan'208";a="5494426" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 10 Dec 2007 22:05:59 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lBAL5wAf024761 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 10 Dec 2007 22:05:58 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGE4XUfAbSoIh2dsb2JhbACPZQEBAQgEBik X-IronPort-AV: E=Sophos;i="4.24,148,1196636400"; d="scan'208";a="6676647" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Dec 2007 22:05:58 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id lBAL5vbG012973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Dec 2007 22:05:57 +0100 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.13.6/8.13.6/Submit) id lBAL5vgw012968 for caml-list@inria.fr; Mon, 10 Dec 2007 22:05:57 +0100 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dslb-088-073-105-066.pools.arcor-ip.net (dslb-088-073-105-066.pools.arcor-ip.net [88.73.105.66]) by webmail.in-berlin.de (IMP) with HTTP for ; Mon, 10 Dec 2007 22:05:56 +0100 Message-ID: <1197320756.475daa34ef083@webmail.in-berlin.de> Date: Mon, 10 Dec 2007 22:05:56 +0100 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] Ask for a more efficient way to deallocate memory (full version) References: <39980.81.57.198.61.1197236388.squirrel@webmail.lpn.cnrs.fr> <95513600712091355j35c4fa65g40bbfce02303796a@mail.gmail.com> <475D2210.70708@Lpn.cnrs.fr> <1197304401.475d6a51d9c06@webmail.in-berlin.de> <20071210202738.GA15084@furbychan.cocan.org> In-Reply-To: <20071210202738.GA15084@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at concorde with ID 475DAA36.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 0100,:01 bandel:01 ocaml:01 foo:01 ocaml:01 orthogonal:01 10,:98 garbage:01 wrote:01 oliver:01 oliver:01 caml-list:01 functions:01 Zitat von Richard Jones : > On Mon, Dec 10, 2007 at 05:33:21PM +0100, Oliver Bandel wrote: > > Zitat von Fabrice Pardo : > > > > [...] > > > When using these kind of external C functions, > > > OCaml seems then less comfortable to the programmer > > > than reference counted languages. > > > > I doubt that reference-count is the reason here. > > perl also uses reference count, but Filehandles > > and Dirhandles have to be closed with close / closedir. > > This isn't true. In Perl file handles are closed at the end of a > scope if they are no longer used. In other words a Perl-equivalent > to > this loop will never use more than a single file descriptor: > > while (true) { > open "foo" > } Oh, so I was wrong here. :( Perl handles Filehandles in a special way (not as other things in perl), and I thought it also handles Filehandles different, in respect to reference counting. Well, some details I've forgotten during the time I rather used OCaml instead of Perl ;-( Thanks for the correction. [...] > There is a really good paper on this subject -- how ref counting and > garbage collection are orthogonal language concepts [...] That was, what I wanted to express, but my example was wrong. Ciao, Oliver