At 08:06 PM 2/22/05 +0100, Paul Colin Gloster wrote:
>However, one valid argument in favor of wastefully declaring all variables
>in advance is that it will be easier to be confident by the time the
>end-product is delivered that it will not run out of memory at runtime
>(albeit perhaps it is using more memory than needed).
>
>Another argument which might apply against declaring variables in the for
>loop headers is that this may be inefficient for speed (but then
>optimizing for speed is often opposed to optimizing for memory).
Are you aware of any compilers that delay expanding the stack appropriately
until the branch is taken? I was under the (uneducated) impression that
they generally just expanded the stack to cover the largest depth needed
within the routine regardless of whether a path with a block local variable
was taken. So block locals would either be added to the end of the stack
or form a kind of end of stack area common/overlay block.
>The original ANSI C has an
>inefficient library routine which was knowingly standardized as such
>because many of the implementations of the function in draft 1980's ANSI C
>were buggy to the point of gross ineffiency, even though this function had
>originally been proposed with the motivation (and simple implementation of
>being) efficient. And years after current ANSI C was standardized in 1999,
>few ANSI C compilers have ever been released.
library routine? Block locals have been legal since pre-ANSI AFAIK and
have usually not been used as a matter of clarity rather than issues of
optimization.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, IIIMessage
Re: [AVR-Chat] Re: What does this error mean?
2005-02-22 by Robert Adsett
Attachments
- No local attachments were found for this message.