[zeromq-dev] zmq_recvmsg jni

Pieter Hintjens ph at imatix.com
Mon Sep 30 13:31:44 CEST 2013


On Mon, Sep 30, 2013 at 1:05 PM, gonzalo diethelm <gdiethelm at dcv.cl> wrote:

>     zmq_msg_t msg;
>     zmq_msg_init (&msg);
>     zmq_recvmsg ((void *) socket, &msg, flags);
>     int size = zmq_msg_size (&msg);
>     void *data = malloc(size);

The zmq_recvmsg allocates the data once, and then there's a second
allocation, and a copy (missing in your code). I'm wondering if there
would not be a way to avoid the extra copy.

-Pieter



More information about the zeromq-dev mailing list