Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
11/10/11 08:24
Read: 567 times
Sweden


 
#184615 - auto variables
Responding to: Lukas Valecky's previous message
Lukas Valecky said:
Per Westermark said:
I think that the Keil C51 compiler/linker has some special handling for small initialized variables.

What does it mean for me?

It is the logic that reuses global variable space for parameters and auto variables that has optimizations depending on if the auto variable is small or large.

With global variables, the initialization comes directly by the runtime library, so no need for any optimization. All initialized data (independent of size) are just placed in consecutive memory positions, allowing the initialized values to be copied (after potentially being decompressed).

But local variables with initial values needs to be initialized on every visit to the function.

Consider if these variables really need to get new values on every call to the function or not.

List of 39 messages in thread
TopicAuthorDate
Keil problem...      Lukas Valecky      11/10/11 03:53      
   Kel support      Per Westermark      11/10/11 05:41      
      Keil support      Erik Malund      11/10/11 06:49      
         Reward for finding bug      Bert Van Den Berg      11/10/11 10:27      
            been tried      Erik Malund      11/10/11 10:51      
               public bug tracker      Maarten Brock      11/11/11 01:09      
                  It's not a KEIL-specific problem ...      Richard Erlacher      11/21/11 11:18      
                     not really      Maarten Brock      11/22/11 03:56      
                        It's those "snapshots" that I meant      Richard Erlacher      11/22/11 07:49      
                           Not true        Per Westermark      11/22/11 08:05      
                              Remember, where you sit determines what you see      Richard Erlacher      11/22/11 22:18      
                                 Concept      Per Westermark      11/23/11 02:11      
                                 I do not ...      Erik Malund      11/23/11 07:04      
                                    Comfort contra mobile phone      Per Westermark      11/23/11 08:30      
                                       Where you sit determines what you see ...      Richard Erlacher      11/24/11 00:58      
                                          You are still assuming you know what other people think/do        Per Westermark      11/24/11 02:49      
                                             You've overlooked the most basic fact ...      Richard Erlacher      11/24/11 16:31      
                                                Unuseful toy?      Per Westermark      11/24/11 17:18      
                                                   Once again, you've missed the point ...      Richard Erlacher      11/26/11 08:46      
                                                      Look for progress, instead of just looking back at history      Per Westermark      11/26/11 10:36      
                                                         are you that lucky?      Erik Malund      11/26/11 10:46      
                                                            Yes      Per Westermark      11/26/11 11:17      
                                                         Consider my position      Richard Erlacher      11/27/11 00:26      
      keil update      Lukas Valecky      11/10/11 07:47      
         auto variables      Per Westermark      11/10/11 08:24      
   Global Variable Initiaization      Michael Karas      11/10/11 06:40      
   just curious      Erik Malund      11/10/11 07:53      
      Always good to hide black-box data in structs      Per Westermark      11/10/11 08:19      
      Initialising array inside struct      Oliver Sedlacek      11/11/11 01:48      
         not necessarily      Jan Waclawek      11/11/11 02:10      
      Library      Lukas Valecky      11/11/11 05:00      
   New facts...      Lukas Valecky      11/11/11 06:35      
      At the very least use static for one-time initialized locals      Per Westermark      11/11/11 06:49      
         it works! thanks...      Lukas Valecky      11/15/11 11:36      
            Look at code in Debugger. It will tell all.      Michael Karas      11/15/11 12:19      
               It's called "Overlaying"      Andy Neil      11/15/11 15:00      
                  Optimization      Per Westermark      11/15/11 15:34      
      are you sure ...      Erik Malund      11/11/11 06:51      
   Thanks...      Lukas Valecky      11/21/11 10:55      

Back to Subject List