[zeromq-dev] Introducing Caravan: Simple, Faithful ZMQ-Bindings for Objective Caml (Pedro Borges)

Guillaume Yziquel guillaume.yziquel at citycable.ch
Mon Apr 4 15:15:34 CEST 2011


Le Monday 04 Apr 2011 à 13:24:17 (+0100), Pedro Borges a écrit :
> On Mon, Apr 4, 2011 at 12:31 PM, Guillaume Yziquel
> <guillaume.yziquel at citycable.ch> wrote:
> > Le Monday 04 Apr 2011 à 12:17:01 (+0100), Pedro Borges a écrit :
> 
> If I allocate a buffer outside the heap, the buffer from ocaml (a
> string) would have to be memcpy'ed to the buffer.

You can also allocate manually (without the helper functions) an OCaml
string block outside of the GC heap and have it called a string in
OCaml. That would have the benefit of easing the implementation of the
finaliser that you feed to ZeroMQ. Though that needs care when it comes
to checking whether or not the buffer has been invalidated.

You can also allocate an OCaml string block on the call stack. It
requires even more care. I wouldn't dare.

-- 
     Guillaume Yziquel



More information about the zeromq-dev mailing list