caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* BA: external managed data freed at finalisation
@ 2008-05-11 14:49 Florent Monnier
  2008-05-13 16:59 ` [Caml-list] " Florent Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Florent Monnier @ 2008-05-11 14:49 UTC (permalink / raw)
  To: caml-list

Hi,

When a bigarray is created from C, where its data part is allocated from a C 
function, I would like to know how to handle the finalisation of this ba ?

Will ocaml make the free() call on the data part when it will be finalised ?

Should one associates a finalisation function and how ?

bigarray_managed = BIGARRAY_EXTERNAL  // Data is not allocated by Caml

-- 
Thanks
Florent


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] BA: external managed data freed at finalisation
  2008-05-11 14:49 BA: external managed data freed at finalisation Florent Monnier
@ 2008-05-13 16:59 ` Florent Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Florent Monnier @ 2008-05-13 16:59 UTC (permalink / raw)
  To: caml-list

> When a bigarray is created from C, where its data part is allocated
> from a C function, I would like to know how to handle the finalisation
> of this ba ?
>
> Will ocaml make the free() call on the data part when it will be
> finalised ?
>
> Should one associates a finalisation function and how ?

First I thought the solution could be to give CAML_BA_EXTERNAL to 
caml_ba_alloc()'s flags then changing the flags member of the returned ba 
adding CAML_BA_MANAGED to it. But now I think one should rather give 
CAML_BA_MANAGED to caml_ba_alloc() but with a non-null pointer, is it right ?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-13 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-11 14:49 BA: external managed data freed at finalisation Florent Monnier
2008-05-13 16:59 ` [Caml-list] " Florent Monnier

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).