What is Leaf function?

A function that calls no other functions. Its return address is never overwritten, so it need not be saved, and it often needs no stack frame at all.

Field: ISA & Assembly

Leaf function in the explanations

Questions that mention Leaf function (1)

  1. A function that calls no other functions (a leaf function) often does not need to save ra on the stack. Why?

Related terms

Return address Stack frame Addressing mode Application binary interface (ABI) Assembler Branch delay slot Callee-saved register Caller-saved register Calling convention Compressed instruction

Back to the glossary