A leaf routine, leaf subroutine, leaf function, or leaf procedure is a function that 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 registers to avoid having to push the return address on the stack, or not allocating a register window on CPU architectures descended from Berkeley RISC.[1]

The term "leaf" refers to their position as leaf nodes in the call graph of the program.

Usually, most non-leaf routines call more than one other function. When this is the case, the majority of function calls in the call graph are calls to leaf routines, because a binary tree has more leaf nodes than non-leaf nodes (assuming that all non-leaf nodes have two children). Consequently, the efficiency of calls to leaf routines often has a significant effect on the efficiency of the whole program.[citation needed]

References

edit
  1. ^ "Leaf Functions (GCC (GNU Compiler Collection) Internals Manual)".


📚 Artikel Terkait di Wikipedia

Leaf

major photosynthetic function and may be dead at maturity, as in some cataphylls and spines. Furthermore, several kinds of leaf-like structures found

Tagged union

Leaf), Node(3, Leaf, Node(4, Leaf, Leaf))) which corresponds to this tree: Now we can easily write a typesafe function that, for example, counts the

List of x86 instructions

addresses for the EXITAC leaf function only - REX prefixes are otherwise permitted but ignored for the instruction. The leaf functions defined for GETSEC (selected

Super Leaf

The Super Leaf (Japanese: スーパーこのは, Hepburn: Sūpā Konoha), also referred to as the Raccoon Leaf or the Tanooki Leaf, is a power-up item that appears in

CPUID

AVX10_VNNI_INT bit is set. The highest function is returned in EAX. This leaf is only present on Xeon Phi processors. This function returns feature flags. When the

Function (computer programming)

both. This overhead is most obvious and objectionable in leaf procedures or leaf functions, which return without making any procedure calls themselves

Leaf spring

but numerous examples of transverse leaf springs exist as well. Leaf springs can serve multiple suspension functions: location, springing, and to some extent

Nissan Leaf

The Nissan Leaf (Japanese: 日産・リーフ, Hepburn: Nissan Rīfu; stylized as LEAF) is a battery electric car produced by Nissan since 2010. It was offered exclusively