From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Malcolm Matalka <mmatalka@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ctypes - to string or to bigarray?
Date: Sun, 28 Feb 2016 20:42:41 +0100 [thread overview]
Message-ID: <1456688561.13827.1.camel@e130.lan.sumadev.de> (raw)
In-Reply-To: <86oab0hcjq.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
Use bigarrays. There is one striking advantage: you need not to make a
copy when calling blocking I/O functions. With strings/bytes you need
to, because another thread could otherwise move the buffer while you are
reading/writing.
Gerd
Am Sonntag, den 28.02.2016, 19:15 +0000 schrieb Malcolm Matalka:
> I'm writing bindings for a library that is just doing I/O and wondering
> what the suggested best practice is around using string or bigarray. It
> seems like using Bigarray is probably the most versatile interface.
> People can decide to do the copying themselves or just use Bigarray
> everywhere.
>
> Are there any other things to consider? Suggestions?
>
> Thanks,
> /Malcolm
>
--
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de
My OCaml site: http://www.camlcity.org
Contact details: http://www.camlcity.org/contact.html
Company homepage: http://www.gerd-stolpmann.de
------------------------------------------------------------
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-02-28 19:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-28 19:15 Malcolm Matalka
2016-02-28 19:42 ` Gerd Stolpmann [this message]
2016-02-29 8:41 ` Jeremy Yallop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456688561.13827.1.camel@e130.lan.sumadev.de \
--to=info@gerd-stolpmann.de \
--cc=caml-list@inria.fr \
--cc=mmatalka@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox