Leaf routine: Difference between revisions

Content deleted Content added
Update to mention various other names. A leaf routine is a routine that happens not to call another routine; a non-leaf routine can become a leaf routine, and *vice versa*, with code changes.
Restrictive clause, so use "that".
 
Line 1:
{{short description|Subroutines in computer science}}
 
A '''leaf routine''', '''leaf subroutine''', '''leaf function''', or '''leaf procedure''' is a [[function (computer programming)|function]] whichthat does not in turn call another function. Some compilers can apply special program optimizations to leaf routines to make them more efficient, such as the use of [[link register]]s to avoid having to push the return address on the stack, or not allocating a [[register window]] on CPU architectures descended from [[Berkeley RISC]].<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/gccint/Leaf-Functions.html|title=Leaf Functions (GCC (GNU Compiler Collection) Internals Manual)}}</ref>
 
The term "leaf" refers to their position as [[leaf node]]s in the [[call graph]] of the program.