caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: <RABIH.ELCHAAR@sgam.com>
To: <matthieu.dubuget@gmail.com>, <caml-list@inria.fr>
Subject: RE: [Caml-list] nonlinear fit function binding
Date: Thu, 31 May 2007 14:22:51 +0200	[thread overview]
Message-ID: <7625D6A1880B4C4DA11D2EBB8B43D2B90282F387@FRDEF-EXMB03.europe.am.socgen> (raw)

[-- Attachment #1: Type: text/plain, Size: 2433 bytes --]

I did a wrapping of the levmar library.

 

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

In the main function, 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 for 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é : jeudi 31 mai 2007 13:43
À : caml-list@inria.fr
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.                                  
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 confidentiels et etablis a l'intention exclusive de ses destinataires. 
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
Societe Generale Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. 
  
Decouvrez l'offre et les services de Societe Generale Asset Management sur le site www.sgam.fr 
  
                                ******** 
  
This message and any attachments (the "message") are confidential and intended solely for the addressees. 
Any unauthorised use or dissemination is prohibited. 
E-mails are susceptible to alteration. 
Neither Societe Generale Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. 
 
Find out more about Societe Generale Asset Management's proposal on www.sgam.com

[-- Attachment #2: Type: text/html, Size: 6614 bytes --]

             reply	other threads:[~2007-05-31 12:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 12:22 RABIH.ELCHAAR [this message]
2007-06-04  7:37 ` Matthieu Dubuget
  -- strict thread matches above, loose matches on Subject: below --
2007-06-05  9:44 RABIH.ELCHAAR
2007-06-05  9:33 RABIH.ELCHAAR
2007-05-25  7:54 matthieu.dubuget
2007-05-31 11:42 ` [Caml-list] " Matthieu Dubuget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7625D6A1880B4C4DA11D2EBB8B43D2B90282F387@FRDEF-EXMB03.europe.am.socgen \
    --to=rabih.elchaar@sgam.com \
    --cc=caml-list@inria.fr \
    --cc=matthieu.dubuget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).