Date: Wed, 15 Jan 2020 08:20:43 -0800 From: Gleb Smirnoff <glebius@freebsd.org> To: Hans Petter Selasky <hps@selasky.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bz@freebsd.org, cem@freebsd.org Subject: Re: svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys Message-ID: <20200115162043.GS39529@FreeBSD.org> In-Reply-To: <ff4026ac-03e2-1b90-9e80-d888bc190a0e@selasky.org> References: <202001150605.00F65Kc8011526@repo.freebsd.org> <20200115061046.GR39529@FreeBSD.org> <ff4026ac-03e2-1b90-9e80-d888bc190a0e@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200115162043.GS39529>
