Mail Archives: djgpp-workers/2001/08/17/12:14:18
> From: "Matthew Conte" <matt AT conte DOT com>
> Date: Fri, 17 Aug 2001 07:06:01 -0400
>
> From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
>
> > 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.
- Raw text -