[ocaml-ctypes] noalloc optimization?

Jeremy Yallop yallop at gmail.com
Thu Mar 31 09:55:32 BST 2016


On 31 March 2016 at 09:18, Malcolm Matalka <mmatalka at gmail.com> wrote:
> I just read https://blogs.janestreet.com/faster-ocaml-to-c-calls/ and am
> wondering if noalloc is supported in Ctypes.  I looked around the API
> documentation a bit and didn't see it but probably missed it.

All the machinery necessary to support noalloc is in place, but it's
not currently switched on because of a difficulty involving callbacks
from C into OCaml.  See the comment here for details:

    https://github.com/ocamllabs/ocaml-ctypes/blob/935d5a11/src/cstubs/cstubs_generate_ml.ml#L107-L113

So the only piece remaining before we flip the switch to start
generating code with noalloc is a small piece of interface design.

There's also an issue open to track the feature:

    https://github.com/ocamllabs/ocaml-ctypes/issues/132


More information about the Ctypes mailing list