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.3 required=5.0 tests=AWL,HTML_MESSAGE,NO_REAL_NAME, 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 BAE23BC69 for ; Thu, 31 May 2007 14:23:01 +0200 (CEST) Received: from parmail02.sgcib.com (parmail02.sgcib.com [207.45.250.34]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4VCN0Ks010078 for ; Thu, 31 May 2007 14:23:01 +0200 X-IronPort-AV: i="4.14,598,1170630000"; d="scan'208,217"; a="196130922:sNHT70906420" Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7A37E.683DB779" X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: RE: [Caml-list] nonlinear fit function binding Date: Thu, 31 May 2007 14:22:51 +0200 Message-ID: <7625D6A1880B4C4DA11D2EBB8B43D2B90282F387@FRDEF-EXMB03.europe.am.socgen> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Caml-list] nonlinear fit function binding Thread-Index: AcejelnBrs3sFFkFTPqwSulsC9+p7AAA1T4w From: To: , X-OriginalArrivalTime: 31 May 2007 12:22:51.0973 (UTC) FILETIME=[689DD750:01C7A37E] X-NAI-Spam-Score: -0.1 X-j-chkmail-Score: MSGID : 465EBE24.001 on discorde : j-chkmail score : XX : 5/20 0 0.000 -> 2 X-Miltered: at discorde with ID 465EBE24.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bigarrays:01 bigarrays:01 matthieu:01 dubuget:01 ocaml:01 pointer:01 bigarray:01 ocaml:01 matthieu:01 dubuget:01 pointer:01 bigarray:01 interdite:98 altere:98 unauthorised:98 This is a multi-part message in MIME format. ------_=_NextPart_001_01C7A37E.683DB779 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I did a wrapping of the levmar library. =20 The approach I chose is to allocate bigarrays from Caml, and pass them to t= he main C function, along with the function f. In the main function, I register f and all the bigarrays as global roots, a= nd then call as many times the c sub function to compute the minimization. =20 Feel free to ask for more precisions if needed Hope this helps. =20 Rabih =20 ________________________________ De : caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inria= .fr] De la part de Matthieu Dubuget Envoy=E9 : jeudi 31 mai 2007 13:43 =C0 : caml-list@inria.fr Objet : Re: [Caml-list] nonlinear fit function binding =20 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. = =20 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.=20 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?=20 Thanks in advance Salutations Matthieu Ce message et toutes les pieces jointes (ci-apres le "message") sont confid= entiels et etablis a l'intention exclusive de ses destinataires.=20 Toute utilisation ou diffusion non autorisee est interdite.=20 Tout message electronique est susceptible d'alteration.=20 Societe Generale Asset Management et ses filiales declinent toute responsab= ilite au titre de ce message s'il a ete altere, deforme ou falsifie.=20 =20 Decouvrez l'offre et les services de Societe Generale Asset Management sur = le site www.sgam.fr=20 =20 ********=20 =20 This message and any attachments (the "message") are confidential and inten= ded solely for the addressees.=20 Any unauthorised use or dissemination is prohibited.=20 E-mails are susceptible to alteration.=20 Neither Societe Generale Asset Management nor any of its subsidiaries or af= filiates shall be liable for the message if altered, changed or falsified.=20 =20 Find out more about Societe Generale Asset Management's proposal on www.sga= m=2Ecom ------_=_NextPart_001_01C7A37E.683DB779 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

I did a wrapping of= the levmar library.

 

The approach I chos= e is to allocate bigarrays from Caml, and pass them to the main C function, along with the function f.

In the main functio= n, I register f and all the bigarrays as global roots, and then call as many times the c = sub function to compute the minimization.

 

Feel free to ask fo= r more precisions if needed

Hope this helps.

 

Rabih

 


De : caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inria.fr] = De la part de Matthieu Dubuget
Envoy=E9 : jeudi 31 mai= 2007 13:43
=C0 : caml-list@inria.f= r
Objet : Re: [Caml-list] nonlinear fit function binding

 

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.            =             &nb= sp;        
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

Ce message et toutes les pieces jointes (ci-apres le "message") sont c=
onfidentiels et etablis a l'intention exclusive de ses destinataires.=20
Toute utilisation ou diffusion non autorisee est interdite.=20
Tout message electronique est susceptible d'alteration.=20
Societe Generale Asset Management et ses filiales declinent toute responsab=
ilite au titre de ce message s'il a ete altere, deforme ou falsifie.=20
 =20
Decouvrez l'offre et les services de Societe Generale Asset Management sur =
le site www.sgam.fr=20
 =20
                                ********=20
 =20
This message and any attachments (the "message") are confidential and inten=
ded solely for the addressees.=20
Any unauthorised use or dissemination is prohibited.=20
E-mails are susceptible to alteration.=20
Neither Societe Generale Asset Management nor any of its subsidiaries or af=
filiates shall be liable for the message if altered, changed or falsified.=20
=20
Find out more about Societe Generale Asset Management's proposal on www.sga=
m=2Ecom
------_=_NextPart_001_01C7A37E.683DB779--