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=1.4 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 42C22BC6B for ; Thu, 31 May 2007 13:42:50 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.233]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4VBgnjO029895 for ; Thu, 31 May 2007 13:42:49 +0200 Received: by nz-out-0506.google.com with SMTP id s18so115441nze for ; Thu, 31 May 2007 04:42:49 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TyHxMPTBMLGf5Sei4HhjCLnU1E0s2mLz2s84Wi6mzSqhKZkcnsNpku9CtbE1wVUkrja2yZFKpqQLZ5R3SGGEdO98ScJkUwR6V/xeHP9UqSyITeyzKIS7x6lfe4bhxHs5zxXy0jGCQtRpRYrCPuxQEORqbuX36b9m94tcWuCFqso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=UVXm9n57n0w58VLb1UpFV/knD8LmL3Melnx9q1dODiw+6yxdozqIC6xLkaThDwv2OKjRfdH/35TRtToR04MRRb/HR5mH/SmuUpTStZqrHS/SqNIdIWP2Wrks4cfo1Yame9ipVOuxGADbzC2pwhznU2YaVY1Wd9WUQ7JE9KmO1nA= Received: by 10.114.93.17 with SMTP id q17mr524693wab.1180611768609; Thu, 31 May 2007 04:42:48 -0700 (PDT) Received: by 10.115.60.4 with HTTP; Thu, 31 May 2007 04:42:48 -0700 (PDT) Message-ID: <9f09a07a0705310442v7682b4c5wdfbee3fe646ab4e6@mail.gmail.com> Date: Thu, 31 May 2007 13:42:48 +0200 From: "Matthieu Dubuget" To: caml-list@inria.fr Subject: Re: [Caml-list] nonlinear fit function binding In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11835_23142816.1180611768575" References: X-j-chkmail-Score: MSGID : 465EB4B9.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 465EB4B9.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 bigarrays:01 ocaml:01 pointer:01 bigarray:01 ocaml:01 bigarrays:01 pointer:01 bigarray:01 W33:98 garbage:01 garbage:01 ------=_Part_11835_23142816.1180611768575 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Well. It seems my former message was unclear? Here is a more precise question: should/could C allocated bigarrays be freed? Context: OCaml calls one C function M, at about 50 Hz. In M, a C function (let's call it A) is locally defined. One pointer to A is given to another function, that calls A more than once. Function A wraps a C array it receives as a parameter into a bigarray, and give it to OCaml through one callback. The whole process is repeated, at about 50 Hz. I do not know if the bigarrays allocated by M are garbage collected in any way, and if they are not, how I could free them in order to avoid any memory leak? Thanks in advance Salutations Matthieu ------=_Part_11835_23142816.1180611768575 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Well. It seems my former message was unclear?

Here is a more precise question: should/could C allocated bigarrays
 be freed?

Context:

OCaml calls one C function M, at about 50 Hz.                                 
In M,  a C function (let's call it A) is locally defined.
One pointer to A is given to another function, that
calls A more than once.

Function A wraps a C array it receives as a parameter
into a bigarray, and give it to OCaml through one callback.

The whole process is repeated, at about 50 Hz.

I do not know if the bigarrays allocated by M are garbage
collected in any way, and if they are not, how I could free
them in order to avoid any memory leak?

Thanks in advance
Salutations

Matthieu
------=_Part_11835_23142816.1180611768575--