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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 24D3BBBAF for ; Fri, 26 Jun 2009 09:29:19 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.42,295,1243807200"; d="scan'208";a="31971876" Received: from arvin.irisa.fr (HELO [131.254.11.86]) ([131.254.11.86]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Jun 2009 09:29:19 +0200 Message-ID: <4A44789B.9000905@irisa.fr> Date: Fri, 26 Jun 2009 09:28:27 +0200 From: Tiphaine Turpin User-Agent: Thunderbird 2.0.0.19 (X11/20090216) MIME-Version: 1.0 To: Christophe Raffalli , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Mastering the garbage collector References: <4A439067.8070104@irisa.fr> <4A4399A2.2090301@irisa.fr> <4A43BE22.1080802@univ-savoie.fr> In-Reply-To: <4A43BE22.1080802@univ-savoie.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; irisa:01 christophe:01 raffalli:01 val:01 inlining:01 cheers:01 christophe:01 beginner's:01 ocaml:01 bug:01 garbage:01 beginners:01 caml-list:01 caml-list:01 bin:01 Christophe Raffalli a écrit : > You need to make sure that a complete GC cycle has run after producing > your result, before > > (Gc.stat ()).Gc.live_words gives you what you want. > > The function you need is that one : > > val full_major : unit -> unit > I already do that before querying the live words count. > let x = ... in > (* here you are not sure x is collected even if the variable does not > appear after this comment *) > Thanks for making this clear. I was indeed thinking that collecting x here could require some sort of variable liveness analysis, and that the GC might not be that smart, and this is why I tried to put x in a function and prevent inlining, but I don't know if it is enough to make x definitely unreachable. > let y = 3 in > ... > > > Cheers, > Christophe > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >