<?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="2009/10/b699fc83fc25d4dfb6ba4705183804af"
  from="Olivier Andrieu &lt;oandrieu@n...&gt;"
  author="Olivier Andrieu"
  date="2009-10-28T15:37:39"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?"
  prev="2009/10/57a3c666e4c3eb4f607f6630601c5bff"
  next="2009/10/99f45aa9c8324508067c19216451bca4"
  prev-in-thread="2009/10/12b1267c3a1909e9477ed39ab6be37a7"
  next-in-thread="2009/10/02a74313db370b81dd3c6315f7190d57"
  prev-thread="2009/10/a542f981ec63f1fb137050f0370eebab"
  next-thread="2009/10/63300d21e98ae03b875913a3e95f0dea"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="How to read different ints from a Bigarray?">
<msg 
  url="2009/10/bbb95d9e0194e1762c52367d01c48687"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T13:57:42"
  subject="How to read different ints from a Bigarray?">
<msg 
  url="2009/10/46931001437bcbb2e09f17cfe7df9981"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T14:17:44"
  subject="Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/8a90d2240c3144428951fc8b8cb530a1"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T15:00:48"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/57a3c666e4c3eb4f607f6630601c5bff"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T15:17:38"
  subject="Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/38da3897544cafcf0076ecf8ed64195c"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T18:01:12"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/49d3727f2409ccf2dd98f311cce6ae25"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T18:20:07"
  subject="Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/38a70da8110050e7ef926b81a62c7e61"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T21:05:28"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/1fb2fd518c360a1be5184a64a0f2ee6c"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T21:26:47"
  subject="Re: How to read different ints from a Bigarray?">
</msg>
</msg>
</msg>
<msg 
  url="2009/10/bf5823ce7568616f364570cd8ba70476"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-10-28T22:48:07"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/4101b452ec63b2748ed42ae54995fa07"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T09:50:35"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/953f05dc40842238508a9582754f2718"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T10:34:50"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
<msg 
  url="2009/10/6511dd596e8b3822f292f446db039088"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-10-29T12:20:49"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/4310df5ec194cc33ea355f8239da4261"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T17:11:08"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/5efd3ac5be44f2f55ec5ca61f3280bb5"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-10-30T20:30:13"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/b49aebddd45e1b64ce359e1fd20405c8"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-11-01T15:11:55"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/635da940c72d170c8317dad01c90ef0b"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-11-01T19:57:50"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/4d025a878558f48af14c5f309995a242"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-11-02T16:11:29"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/27802294c3fc891d0c2fb6388296d1f5"
  from="Mauricio Fernandez &lt;mfp@a...&gt;"
  author="Mauricio Fernandez"
  date="2009-11-02T16:33:27"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/6800529d761a4da0d1d1c7aff4767544"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-11-02T20:27:02"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/11/c237af6592d90c0f97fc6093bb34c20e"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-11-03T13:18:52"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
</msg>
<msg 
  url="2009/11/713525c1fcc41fa56a8d7371779cb6eb"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-11-02T20:48:11"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/10/161893143f67c350977b99d7f97e55a9"
  from="Florian Weimer &lt;fw@d...&gt;"
  author="Florian Weimer"
  date="2009-10-29T20:40:13"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/30586559793975360d90892ea66b67c9"
  from="Gerd Stolpmann &lt;gerd@g...&gt;"
  author="Gerd Stolpmann"
  date="2009-10-29T20:59:07"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/507822c6b31e007dc642e512f676fb95"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T23:43:14"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/1fa25b75a89559ed7c63df5845298c27"
  from="Gerd Stolpmann &lt;gerd@g...&gt;"
  author="Gerd Stolpmann"
  date="2009-10-30T00:43:59"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
</msg>
</msg>
<msg 
  url="2009/10/12b1267c3a1909e9477ed39ab6be37a7"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T23:38:57"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/10/b699fc83fc25d4dfb6ba4705183804af"
  from="Olivier Andrieu &lt;oandrieu@n...&gt;"
  author="Olivier Andrieu"
  date="2009-10-28T15:37:39"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
<msg 
  url="2009/10/02a74313db370b81dd3c6315f7190d57"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T16:05:56"
  subject="Re: How to read different ints from a Bigarray?">
</msg>
</msg>
<msg 
  url="2009/10/99f45aa9c8324508067c19216451bca4"
  from="Gerd Stolpmann &lt;gerd@g...&gt;"
  author="Gerd Stolpmann"
  date="2009-10-28T15:38:04"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
<msg 
  url="2009/10/14d54df8c72e192b79db94d2c1fac31d"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-28T16:10:10"
  subject="Re: How to read different ints from a Bigarray?">
</msg>
<msg 
  url="2009/10/ebf17417fbc6f4e6317a1582dc10cd69"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T18:37:06"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
</msg>
</msg>
<msg 
  url="2009/10/cffc1ff39a3e25f217348767d8336769"
  from="Xavier Leroy &lt;Xavier.Leroy@i...&gt;"
  author="Xavier Leroy"
  date="2009-10-28T17:10:04"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
<msg 
  url="2009/10/39a4e2380bdf79a6b8604c9f1ed8dc03"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-28T19:05:59"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
</msg>
<msg 
  url="2009/10/a8d579c804005ce1954c686973f455af"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T17:05:55"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
<msg 
  url="2009/10/242a11844cb0d850e2c76b2f006e61b1"
  from="Christophe TROESTLER &lt;Christophe.Troestler+ocaml@u...&gt;"
  author="Christophe TROESTLER"
  date="2009-10-29T18:42:39"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
<msg 
  url="2009/10/033810682bfd9b0436bf52c3c97715e7"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T19:03:19"
  subject="Re: [Caml-list] How to read different ints from a Bigarray?">
</msg>
</msg>
<msg 
  url="2009/10/454ba49ae093f226d01d7090512007cf"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-10-29T18:49:00"
  subject="Re: How to read different ints from a Bigarray?">
<msg 
  url="2009/10/e586cb51b535fb11719cb9caa0bf3398"
  from="Goswin von Brederlow &lt;goswin-v-b@w...&gt;"
  author="Goswin von Brederlow"
  date="2009-10-29T23:25:23"
  subject="Re: [Caml-list] Re: How to read different ints from a Bigarray?">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Wed, Oct 28, 2009 at 14:54, Goswin von Brederlow &lt;goswin-v-b@web.de&gt; wrote:
&gt; Hi,
&gt;
&gt; I'm working on binding s for linux libaio library (asynchron IO) with
&gt; a sharp eye on efficiency. That means no copying must be done on the
&gt; data, which in turn means I can not use string as buffer type.

hmm I think you could try with strings.
You need to allocate the storage yourself (with malloc) but then, as
long as you properly set up the header and last field of the block as
OCaml does for its native strings, the runtime will use it without
problems. The GC will see that the block is outside the Caml heap and
won't try to manage it.
And on the Caml side you can use it as a regular string.
The only caveat I know is that this disrupts the polymorphic
comparison function a bit.

That's worth a try IMO.



Sylvain Le Gall &lt;sylvain@le-gall.net&gt; wrote:
&gt; &gt; PS: Is a.{i} &lt;- x a C call?
&gt; Yes.

really ? Given the number of Pbigarray* constructors in the compiler
code, I'd be surprised :)
No I think that for some cases like "accessing a 64bits bigarray on a
32bits arch" result in a C call, but otherwise it's handled by the
compiler.

-- 
  Olivier

</contents>

</message>

