Jump to content

Leaf subroutine

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by GVnayR (talk | contribs) at 00:06, 12 April 2020 (+short description). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A leaf subroutine is a subroutine which cannot in turn call another subroutine. Some compilers can apply special program optimizations to leaf subroutines, such as the use of link registers 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 of the program.