<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/01328f4302f99cdf82587651fd28d126"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2002-07-08T14:21:02"
  subject="Re: [Caml-list] finalizing bigarrays"
  prev="2002/07/7e2792e8388e42aaaa374716c37998e6"
  next="2002/07/d84193189834bb0b419bebbe8b34fe34"
  prev-in-thread="2002/07/7e2792e8388e42aaaa374716c37998e6"
  prev-thread="2002/07/a5e8fb42c629d04a23cbf4074c167426"
  next-thread="2002/07/d84193189834bb0b419bebbe8b34fe34"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] finalizing bigarrays">
<msg 
  url="2002/07/7e2792e8388e42aaaa374716c37998e6"
  from="Fernando Alegre &lt;fernando@c...&gt;"
  author="Fernando Alegre"
  date="2002-07-08T13:28:04"
  subject="[Caml-list] finalizing bigarrays">
<msg 
  url="2002/07/01328f4302f99cdf82587651fd28d126"
  from="Olivier Andrieu &lt;andrieu@i...&gt;"
  author="Olivier Andrieu"
  date="2002-07-08T14:21:02"
  subject="Re: [Caml-list] finalizing bigarrays">
</msg>
</msg>
</thread>

<contents>
 Fernando Alegre [Monday 8 July 2002] :
 &gt; 
 &gt; Are there any plans to add a "finalize" function to externally
 &gt; managed bigarrays?
 &gt; 
 &gt; We have a C library that allocates bigarrays in a certain complex
 &gt; way and needs to deallocate them when the bigarrays are no longer
 &gt; in use. We have thought of several ways to do this, but neither is
 &gt; optimal, except the last one:
 &gt; 
 &gt; 1) Wrap the bigarray in a custom type that we need to drag along
 &gt;    with it all the time. The finalizer in the custom type will then
 &gt;    deallocate the bigarray.

How about defining

  external finalise_my_bigarray : ('a, 'b, 'c) Bigarray.Genarray.t -&gt; unit

and then using

  Gc.finalise ?


-- 
   Olivier
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

