From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id AAF27BBAF for ; Wed, 24 Nov 2010 05:06:12 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwBAH8d7EzRVdI0jmdsb2JhbACUbo18CBYBAgkLCAkPBR+jVIlkghiFCC6IWQEBAwWFRwSEWoYFgw9m X-IronPort-AV: E=Sophos;i="4.59,246,1288566000"; d="scan'208,217";a="80822216" Received: from mail-pz0-f52.google.com ([209.85.210.52]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Nov 2010 05:06:12 +0100 Received: by pzk3 with SMTP id 3so18121pzk.39 for ; Tue, 23 Nov 2010 20:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=jM7tWzoRgfDWel7wCD3LiJ4B6CoKMaBxQ1118Pac2A0=; b=W/BrxSXvGFEbGT9/WLrSSHQ5KI03RY+neG9smIzksIo/5d9lqfsMII7AHOts/FBSJ1 j2Fx+FrCRRpYfJcGlpnmbdoCSJ5SW5Nis3iwRItdu3wBkeRmbEExmsbBzrPWnCGKO2R/ ifLZ4TyFaGBMIgSjTtqBNl4KkJm4+ImO8byWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=WsqoZF+hO0F50yYgfih0DTx7YYiiuZyzA5amOct7Vuo1mrgLfNFsy+2cGqHTte2qyj ggbyYI3EX/+QVIzLz71jJj0qf04vU7BEJCbCosDLIe1N6URrByCZtdweONJcI00ZQn0T QNsstl90QPVrgjBKlWnIzyoIPJc5YyN8sjY3w= Received: by 10.142.200.6 with SMTP id x6mr7766231wff.351.1290571571069; Tue, 23 Nov 2010 20:06:11 -0800 (PST) Received: from [192.168.2.2] (adsl-71-135-99-49.dsl.pltn13.pacbell.net [71.135.99.49]) by mx.google.com with ESMTPS id e14sm8834476wfg.20.2010.11.23.20.06.08 (version=SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 20:06:09 -0800 (PST) Message-ID: <4CEC8F2F.8010800@gmail.com> Date: Tue, 23 Nov 2010 20:06:07 -0800 From: Edgar Friendly User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13pre) Gecko/20101113 Shredder/3.1.7pre MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml memory leak issue References: <201011231954241577004@cecs.pdx.edu> In-Reply-To: <201011231954241577004@cecs.pdx.edu> Content-Type: multipart/alternative; boundary="------------050206010307040001060706" X-Spam: no; 0.00; ocaml:01 printf:01 pointers:01 ocaml's:01 pointer:01 printf:01 pointers:01 ocaml's:01 pointer:01 edgar:98 freeing:98 freeing:98 wrote:01 wrote:01 verdana:98 This is a multi-part message in MIME format. --------------050206010307040001060706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 11/23/2010 07:54 PM, Kecheng wrote: > let test = > let a = 1 in > let b = a + 5 in > printf "%d\n" b; > ;; > test;; This will finish with a bunch of allocated memory missing pointers to it. But that's not a problem, because OCaml's GC is capable of freeing this memory, as opposed to a C program, which would need a pointer to the memory to free() it. E. --------------050206010307040001060706 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/23/2010 07:54 PM, Kecheng wrote:
let test  =
    let a = 1 in
    let b = a + 5 in
    printf "%d\n" b;
;;
test;;
This will finish with a bunch of allocated memory missing pointers to it.  But that's not a problem, because OCaml's GC is capable of freeing this memory, as opposed to a C program, which would need a pointer to the memory to free() it.

E.
--------------050206010307040001060706--