Mail Archives: djgpp/1996/01/03/12:09:50
Thomas Sames (tsames AT atl DOT mindspring DOT com) wrote:
: You can also use an offset from the stack to obtain the passed
: parameter to the function. This is faster for a 386 but for the 486
: and pentuim, use the local variable.
True but be careful about that : the compiler may "push" a few
registers on the stack before the function code itself, thus
destroying your knowledge of "what's-where" relative to ESP. If you
meant EBP, it's quite more safe, but your program won't be able to
compile both with and with out the "-fomit-frame-pointer" option. I
know it's a bit buggy (specially with C++), but for for small
functions that can't be inlined (like those that are called via a
pointer) it can dramatically improve speed. The point in what I wrote
was : Leave to GCC as much work as possible : it's almost the only one
who knows how to play in its mud... :-)
Hope this helps...
Igx, The dreaming drummer...
-----------------------------------------------------------------------------
Igx, The dreaming drummer... in real(???) life : Jean-Marc CHALLIER
email : challier AT irit DOT fr | J-M CHALLIER,
pmail : IR1-17, UPS, 18 rte de Narbonne | 18, Bd Griffoul Dorval
31000 Toulouse - FRANCE | 31400 Toulouse - FRANCE
phone : (33) 61-55-63-57 | Tel : (33) 62-16-35-92
- Raw text -