<?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="2003/01/bcec04263a1c7a487d0b250728b97452"
  from="Daniel Andor &lt;da209@c...&gt;"
  author="Daniel Andor"
  date="2003-01-12T01:03:19"
  subject="Re: [Caml-list] C -&gt; CAML linking: loosing values in arrays??"
  prev="2003/01/a3f8af61dda21ed4c9413a149d64bf07"
  next="2003/01/cea91efb37cfa81c5f9b96f1607c587c"
  prev-in-thread="2003/01/a3f8af61dda21ed4c9413a149d64bf07"
  next-in-thread="2003/01/3805be8a550d5c992f50ef38d54d300a"
  prev-thread="2003/01/b3381ea52ca855463acfe1b560847b5a"
  next-thread="2003/01/ae290911e3ac98ba444f0ad41ede595f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] C -&gt; CAML linking: loosing values in arrays??">
<msg 
  url="2003/01/ebd86b28c2ef28b50a46fde80caaf934"
  from="Daniel Andor &lt;da209@c...&gt;"
  author="Daniel Andor"
  date="2003-01-11T19:08:35"
  subject="[Caml-list] C -&gt; CAML linking: loosing values in arrays??">
<msg 
  url="2003/01/a3f8af61dda21ed4c9413a149d64bf07"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-01-12T00:15:49"
  subject="Re: [Caml-list] C -&gt; CAML linking: loosing values in arrays??">
<msg 
  url="2003/01/bcec04263a1c7a487d0b250728b97452"
  from="Daniel Andor &lt;da209@c...&gt;"
  author="Daniel Andor"
  date="2003-01-12T01:03:19"
  subject="Re: [Caml-list] C -&gt; CAML linking: loosing values in arrays??">
</msg>
</msg>
<msg 
  url="2003/01/3805be8a550d5c992f50ef38d54d300a"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-01-15T15:09:23"
  subject="Re: [Caml-list] C -&gt; CAML linking: loosing values in arrays??">
</msg>
</msg>
</thread>

<contents>
Thanks to you and Basile, who also replied.

I think I now understand that I need to use the more low-level alloc() 
function with the appropriate tag, since there doesn't seem to be a version 
of alloc_array() suitable for doubles.

At the moment my main worry is that I'm allocating new arrays to pass to the 
function faster than the gc can clean them up... I need to find out about 
hanging on to allocated values on the C side of things.

Thanks,
Daniel.

On Saturday 11 January 2003 11:20 pm, Artem Prisyznuk wrote:
&gt; 11.01.03 22:07:51, Daniel Andor &lt;da209@cam.ac.uk&gt; wrote:
&gt; &gt;If I pass a non-array double using copy_double(), it works and I get the
&gt; &gt;correct number on the other side.
&gt; &gt;
&gt; &gt;Any ideas as to where I've gone wrong?
&gt;
&gt; From Caml manual:
&gt;
&gt; ....
&gt; 18.3.3
&gt; Arrays
&gt;
&gt; Arrays of integers and pointers are represented like tuples, that is, as
&gt; pointers to blocks tagged 0. They are accessed with the Field macro for
&gt; reading and the modify function for writing.
&gt;
&gt; Arrays of floating-point numbers (type float array) have a _special,
&gt; unboxed_, more efficient representation. These arrays are represented by
&gt; pointers to blocks with tag Double_array_tag. They should be accessed with
&gt; the Double_field and Store_double_field macros. ....
&gt;
&gt; &gt;Thanks,
&gt; &gt;Daniel.
&gt; &gt;-------------------
&gt; &gt;To unsubscribe, mail caml-list-request@inria.fr Archives:
&gt; &gt; http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
&gt; &gt; http://caml.inria.fr/FAQ/ Beginner's list:
&gt; &gt; http://groups.yahoo.com/group/ocaml_beginners
&gt;
&gt; -------------------
&gt; To unsubscribe, mail caml-list-request@inria.fr Archives:
&gt; http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
&gt; http://caml.inria.fr/FAQ/ Beginner's list:
&gt; http://groups.yahoo.com/group/ocaml_beginners

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

