Tips And Tricks

Place A Statically Determinable Upper-Bound On All Loops

Having a statically determinable upper-bound on all loops creates a directed acyclic call graph of your program. This can help static-analysis tools determine the upper-limits of stack/memory usage.

The exceptions to this rule include:

  • The main-event loop of a task.
  • while(1) statements inserted for special-case scenarios (e.g. processor stress-testing, debugging, handling critical errors).

Posted: October 23rd, 2015 at 9:17 am
Last Updated on: August 15th, 2017 at 10:55 am