zeromq/czmq — pull request #153 by ulikoehler (2013-04-30 18:56:29+00:00)
Title: Add zero-copy version of zmsg_addmem

Currently it is not possible to add a zero-copy frame to a zmsg without first constructing it using zframe_new_zero_copy(...) and then adding it using zmsg_add(). This pull request adds zmsg_addmem_zero_copy(...).

In my particular use case, a large number of frames have content that is known at compile-time (therefore there's no need to memcpy() the constant data around and free() it later - I can use zframe_new_zero_copy() with a free function that does nothing) - I think if there's zmsg_addmem(...) as shortcut for zmsg_add(zframe_new(...)), there also should be zmsg_addmem_zero_copy(...) as shortcut for zmsg_add(zframe_new_zero_copy(...)).

Please feel free to tell me your opinion on this!