Embedded Software Engineer Question:
Tell me what happens when recursive functions are declared inline?
Answer:
Inlining an recursive function reduces the overhead of saving context on stack. But, inline is merely a suggestion to the compiler and it does not guarantee that a function will be inlined. Obviously, the compiler won't be able to inline a recursive function infinitely. It may not inline it at all or it may inline it, just a few levels deep.
Previous Question | Next Question |
Please explain what is semaphore? | Tell me what is difference between binary semaphore and mutex? |