[zeromq-dev] C++ Move Constructor and Assignment Operator

Christoph Heindl christoph.heindl at gmail.com
Thu Feb 14 10:43:09 CET 2013


Hi Richard,

On Thu, Feb 14, 2013 at 10:14 AM, <Richard_Newton at waters.com> wrote:

>
> I believe zeromq does this is by design. It copies the data if the message
> size is small and reference counts it if its above a certain size.
>
Ok, I did not know that. Would by interesting to know why. Is ZMQ using
some kind of small buffer optimization, where it uses the first few bytes
of the buffer for reference counter or storing the values if small enough?

>
>
> It looks like the size threshold is specified by the max_vsm_size enum in
> msg.hpp, currently set to 29, so if you make your message size 30 it should
> switch to reference counting.
>
I did and it works. Added both, positive and negative tests.

Thanks for the hint.

Best,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130214/e3795f2e/attachment.html>


More information about the zeromq-dev mailing list