svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
Gleb Smirnoff
glebius at freebsd.org
Wed Jan 15 16:20:47 UTC 2020
On Wed, Jan 15, 2020 at 09:51:02AM +0100, Hans Petter Selasky wrote:
H> On 2020-01-15 07:10, Gleb Smirnoff wrote:
H> > I really want to reverse the argument order of epoch_call() as well.
H> > The current order is really backwards:
H> >
H> > void
H> > epoch_call(epoch_t epoch, epoch_context_t ctx,
H> > void (*callback)(epoch_context_t));
H> >
H> > Suggested declaration is:
H> >
H> > void
H> > epoch_call(epoch_t epoch, epoch_context_t ctx,
H> > void (*callback)(epoch_context_t));
H>
H> I think he meant to put the ctx argument last. Look at how the function
H> is implemented to see if that makes any sense, I.E. how arguments are
H> optimised.
Yes, of course. I had too little tea last night and didn't swap
arguments after copy-n-paste. Suggested prototype is:
void
epoch_call(epoch_t epoch, void (*callback)(epoch_context_t),
epoch_context_t ctx);
H> Is this *want* just because of "function, argument" is better than
H> "argument, function" ?
Sure. There is no practical impact on how a CPU will execute. It is
all about how a human reads a code.
--
Gleb Smirnoff
More information about the svn-src-all
mailing list