From: Jeremy Yallop <yallop@gmail.com>
To: Francois Berenger <berenger@riken.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ANN: ocaml-ctypes, a library for calling C functions directly from OCaml
Date: Fri, 7 Jun 2013 09:16:50 +0100 [thread overview]
Message-ID: <CAAxsn=GiBcGNhu_sVj1N6-LNNU0oXReWz=mD_B=tqmVSdqY49g@mail.gmail.com> (raw)
In-Reply-To: <51B13721.1070101@riken.jp>
On 7 June 2013 02:28, Francois Berenger <berenger@riken.jp> wrote:
> How about the cost of exchanging values between C and OCaml?
>
> Is there a trick in ocaml-ctypes like there is for bigarrays?
Array and struct memory in ocaml-ctypes is managed similarly to the
way bigarray does things, i.e. objects are allocated on the C heap, so
both C and OCaml functions can safely access them without copying.
However, there's no special compiler support for ocaml-ctypes as there
is for bigarrays, so it's likely that array access will be slower for
the moment.
Of course, arrays in ocaml-ctypes also have some advantages over
bigarrays. For example, they can hold a broader range of data --
structs, pointers, and so on.
I'm hoping to add bigarray integration to ocaml-ctypes at some point.
prev parent reply other threads:[~2013-06-07 8:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 23:17 Jeremy Yallop
2013-06-07 1:28 ` Francois Berenger
2013-06-07 2:06 ` Anthony Tavener
2013-06-07 8:16 ` Jeremy Yallop [this message]
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='CAAxsn=GiBcGNhu_sVj1N6-LNNU0oXReWz=mD_B=tqmVSdqY49g@mail.gmail.com' \
--to=yallop@gmail.com \
--cc=berenger@riken.jp \
--cc=caml-list@inria.fr \
/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