3 ms·
recursion on embedded devices is terrible… you have very little memory.
by guappa 1y ago
recursion on embedded devices is terrible… you have very little memory.
- praptak 1y agoIt's more about having an easily verifiable limit on the size of the call stack. You can still use recursion in algorithms with this rule. It just forces you to allocate a separate stack to manage it.
- guappa 1y agoSeparate stack still uses memory, you need to prove the bounds.
- praptak 1y agoYes. My point is that: 1. "No cycles in call graph" is not about memory usage but about having an easily provable limit on call stack and 2. "No cycles in call graph" is not about banning recursion. I agree that the call stack limit is much more important in environments with tight memory but the rule is about the stack limit, not memory in general. Edit: for 2. I obviously mean recursion as the class of algorithms, not as the property of the functions used to implement it.