<?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/eb7e65c65029f1e6bf7b5106092b9fba"
  from="Fernando Alegre &lt;fernando@c...&gt;"
  author="Fernando Alegre"
  date="2002-07-10T02:21:17"
  subject="[Caml-list] more bigarray problems"
  prev="2002/07/235b6d01ac3436001b15edcd52ef8cea"
  next="2002/07/2949c91a86a23e8a3f60bf77af393224"
  prev-thread="2002/07/235b6d01ac3436001b15edcd52ef8cea"
  next-thread="2002/07/2949c91a86a23e8a3f60bf77af393224"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] more bigarray problems">
<msg 
  url="2002/07/eb7e65c65029f1e6bf7b5106092b9fba"
  from="Fernando Alegre &lt;fernando@c...&gt;"
  author="Fernando Alegre"
  date="2002-07-10T02:21:17"
  subject="[Caml-list] more bigarray problems">
</msg>
</thread>

<contents>

After I thought we had tamed bigarrays, it seems we did not. Certain
operations such as slices and reshaping allocate new bigarray structs. They
use the stock bigarray_alloc instead of the custom one, of course, and so
they bypass the finalizers. We managed to make OCaml segfault for this!

I don't see any way to work around that problem other than having support for
external finalizers in bigarray_alloc, and having proxies and slices
remember them. Even with a perfectly working Gc.finalise, we would encounter
the same problem, as the finalizers will get forgotten after a reshape, not
a very nice feature...

I think, given this input, lack of finalization support in bigarrays should be
promoted from just a feature wish to a bug, since there seems to be no way
to work around it.

Thanks,
       Fernando

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

