[zeromq-dev] [PATCH] Message-related functionality factored out into msg_t class.
Martin Sustrik
sustrik at 250bpm.com
Wed Apr 27 10:29:07 CEST 2011
On 04/26/2011 07:03 PM, Pieter Hintjens wrote:
> OK, I have one review comment on this change.
>
> Actually, two. The first is my usual complaint that a link to
> https://github.com/zeromq/libzmq/commit/e0246e32d79d71f8e73207b43aed8b23648e4fc7
> would be helpful and cheap.
At the point I post the patch it's not yet in the repo. I wait a day or
two so there is at least some time for review and apply it afterwards.
In short, the link doesn't exist yet when I'm sending the email.
> My real comment is that you still define the zmq_msg_t structure publicly as:
>
> typedef unsigned char zmq_msg_t [32];
>
> which kind of defeats the ability to change the structure by calling a
> new library.
Can you explain, please? I don't get it.
> I've explained how to use opaque types properly in C, is
> there a reason you're not doing that?
The reason why opaque pointers cannot be used is to allow allocating
messages on the stack. That cannot be achieved with opaque pointers as
they have no associated size.
Martin
More information about the zeromq-dev
mailing list