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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/04/11 16:51
Read: times


 
Msg Score: +2
 +2 Good Answer/Helpful
#184027 - WIthout Static In This Case
Responding to: ???'s previous message
Without the static the subroutine performance will probably go way way down on some platforms. For those platforms that allocate non-static local variables on a stack the initializer will cause there to be a block copy to initialize the local table every time the subroutine is invoked. This would be different for some 8051 type compilers such as Keil that do not allocate locals to a stack and may very well optimize the run time code to be the equivalent of what you get with the static attribute.

Michael Karas


List of 18 messages in thread
TopicAuthorDate
Another static question...            01/01/70 00:00      
   WIthout Static In This Case            01/01/70 00:00      
      Thank you            01/01/70 00:00      
      It is worse than that            01/01/70 00:00      
         could add 'const'            01/01/70 00:00      
         That's the key!            01/01/70 00:00      
         Thanks Neil            01/01/70 00:00      
      True - but not quite the point here            01/01/70 00:00      
   isn't it explained in the book itself?            01/01/70 00:00      
      Yes, it is            01/01/70 00:00      
      Yes, but...            01/01/70 00:00      
         If the pupil does not understand...            01/01/70 00:00      
            In this instance...            01/01/70 00:00      
               That is why the call it learning.            01/01/70 00:00      
   isn't this just another example of ....            01/01/70 00:00      
      Information-hiding            01/01/70 00:00      
         not arguing that part            01/01/70 00:00      
            Not just protection. Also better overview (and reuse)            01/01/70 00:00      

Back to Subject List