In message <55903c38d363aef2a6f6d0075dd4526b86d51258.ca...@freebsd.org>, 
Ian Le
pore writes:
> On Tue, 2020-06-16 at 07:05 +0000, Toomas Soome wrote:
> > Author: tsoome
> > Date: Tue Jun 16 07:05:03 2020
> > New Revision: 362217
> > URL: https://svnweb.freebsd.org/changeset/base/362217
> > 
> > Log:
> >   loader: variable i is unused without MBR/GPT support built in
> >   
> >   Because i is only used as index in for loop, declare it in for
> > statement.
> > 
>
> As much as I prefer doing it this way, style(9) doesn't allow for
> variable declarations inside a for() statement (or even inside a local
> block, which is just too 1980s for me, but it is still our standard).

Doesn't this use stack for a shorter period of time or does the compiler 
optimize this, making this change moot?

The tradeoff is a few extra bytes of stack for a longer period of time vs a 
few extra instructions incrementing and decrementing the stack pointer.


-- 
Cheers,
Cy Schubert <cy.schub...@cschubert.com>
FreeBSD UNIX:  <c...@freebsd.org>   Web:  https://FreeBSD.org
NTP:           <c...@nwtime.org>    Web:  https://nwtime.org

        The need of the many outweighs the greed of the few.


_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to