Skip to main content
2 of 2
Expand discussion of stack-frames
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 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.

JRobert
  • 15.4k
  • 3
  • 25
  • 53