[zeromq-dev] Zero-copy message API
Martin Sustrik
sustrik at 250bpm.com
Mon Apr 4 07:06:01 CEST 2011
Hi Shonari,
> I don't think that the API needs to change at all. However, the
> documentation is a little misleading:
>
> "If provided, the deallocation function ffn shall be called once the
> data buffer is no longer required by ØMQ, with the data and hint
> arguments supplied to zmq_msg_init_data().".
>
> This sentence indirectly says the following: if there is any clean-up
> to be done once the data buffer is no longer required by ØMQ, then it
> must be done in the deallocation function ffn (emphasis on the
> _must_).
>
> I think that fewer people will be tripped up by this function if it
> explicitly stated that ffn is not optional if memory must be freed at
> all (i.e. memory cannot be freed at some arbitrary point in the
> future, instead, one must wait until the data buffer is no longer
> required by ØMQ, which can only be guaranteed by use of ffn).
Feel free to submit a patch to the documentation.
Martin
More information about the zeromq-dev
mailing list