Leaf subroutine
Encyclopedia
A leaf subroutine is a subroutine
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....

 which cannot in turn call another subroutine. Some compilers can apply special program optimizations to leaf subroutines, such as the use of link register
Link register
A link register, in many instruction set architectures such as the PowerPC, ARM, and the PA-RISC, is a special purpose register which holds the address to return to when a function call completes...

s to avoid having to push the return address on the stack.

The term "leaf" refers to their position as leaf nodes in the call graph
Call graph
A call graph is a directed graph that represents calling relationships between subroutines in a computer program. Specifically, each node represents a procedure and each edge indicates that procedure f calls procedure g...

of the program.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK