• Jens Auer's avatar
    "zero-copy" raw_decoder · 36797936
    Jens Auer authored
    A memcpy is eliminated when receiving data on a ZMQ_STREAM socket. Instead
    of receiving into a static buffer and then copying the data into the
    buffer malloced in msg_t::init_size, the raw_decoder allocates the memory
    for together with the reference-counter and creates a msg_t object
    on top of that memory. This saves the memcpy operation.
    
    For small messages, data is still copied and the receive buffer is reused.
    36797936
v2_decoder.hpp 2.72 KB