Date: Fri, 17 Aug 2001 19:13:17 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Matthew Conte" Message-Id: <8011-Fri17Aug2001191316+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <002d01c1270c$9bf80ca0$e33e1d18@nycap.rr.com> (matt@conte.com) Subject: Re: Fstat.c patch References: <003001c12702$4df56430$0a02a8c0 AT acceleron> <4331-Fri17Aug2001131335+0300-eliz AT is DOT elta DOT co DOT il> <002d01c1270c$9bf80ca0$e33e1d18 AT nycap DOT rr DOT com> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Matthew Conte" > Date: Fri, 17 Aug 2001 07:06:01 -0400 > > From: "Eli Zaretskii" > > > This is okay, but please take the call to _my_ds out of the loop. > > Instead, call it once, and then use the result in the loop body. > > isn't _my_ds just an inline function that will expand to one > instruction Only if you compile with optimizations. Also, isn't a move from a segment register slower than from a general-purpose register? > (and won't require possibly temporary stack space to save > in a temp variable) ? I'd expect that variable to go into a register, since it's used inside a loop. Note that this code is part of `fstat', which is already quite expensive. Anyway, this is a minor point. I didn't meant to say that there's some gross inefficiency here. It just doesn't seem clean to me to hav a function call inside a loop, when we know that its return value is constant.