[nanomsg] Re: inline functions vs. macros

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2013 09:01:15 +0200

On 20/08/13 20:48, Chip Salzenberg wrote:
Well, I was going to get to asserts soon enough... but no.  I meant
e.g. NN_CMSG_FIRSTHDR, NN_CMSG_DATA, etc.  The sort of thing that would
have been a normal function except for efficiency concerns.

I see.

Well, the ancillary data macros are there only for POSIX compliance. In reality, the only field returned in ancillary data is SP-level message header, so I guess the macros could be hugely simplified.

As for macro vs. function discussion, I've checked how the macros are implemented in Linux and done it in similar way. I guess the motivation was to make it as efficient as possible.

Martin


Other related posts: