Skip to main content
Expand discussion of stack-frames
Source Link
JRobert
  • 15.4k
  • 3
  • 25
  • 53

Your functions won't cease to exist. All of the code in your compiled and linked code image gets loaded into code-memory (Flash) and it stays there throughout the run, through resets, and through power-cycles, until another image is loaded over it. 

Are you confusing pointers to functions with pointers to a function's local variables, which occupy RAM memory, specifically inwithin the function's stack area-frame which is transient, being created and "destroyed" as the function gets called and returns - and successive stack-frames won't necessarily be created in the same place.

Your functions won't cease to exist. All of the code in your compiled and linked code image gets loaded into code-memory (Flash) and it stays there throughout the run, through resets, and through power-cycles, until another image is loaded over it. Are you confusing pointers to functions with pointers to a function's local variables, which occupy RAM memory, specifically in the function's stack area which is transient, being created and "destroyed" as the function gets called and returns.

Your functions won't cease to exist. All of the code in your compiled and linked code image gets loaded into code-memory (Flash) and it stays there throughout the run, through resets, and through power-cycles, until another image is loaded over it. 

Are you confusing pointers to functions with pointers to a function's local variables which occupy RAM memory, specifically within the function's stack-frame which is transient, being created and "destroyed" as the function gets called and returns - and successive stack-frames won't necessarily be created in the same place.

Source Link
JRobert
  • 15.4k
  • 3
  • 25
  • 53

Your functions won't cease to exist. All of the code in your compiled and linked code image gets loaded into code-memory (Flash) and it stays there throughout the run, through resets, and through power-cycles, until another image is loaded over it. Are you confusing pointers to functions with pointers to a function's local variables, which occupy RAM memory, specifically in the function's stack area which is transient, being created and "destroyed" as the function gets called and returns.