|ARM Technical Support Knowledge Articles|
A 'leaf function' is the classification given to a function at the end of a call tree.
f4 / \ / \ f1 f5 f8 /\ / \ | / \ / \ | f2 f3 f6 f7 f9
In the diagram above, functions
f9 are leaf functions. These functions are called by functions
f8 respectively, but these functions do not make any calls themselves.
The ARM Application Binary Interface mandates that the stack must be 8-byte aligned at all "externally visible boundaries", i.e. when one function calls another. By definition, a leaf function makes no calls to other functions, and so does not need to maintain this 8-byte stack alignment.
To help you remember what a leaf function is, picture an image of a deciduous tree. There are no more branches or twigs that stem from a leaf. The leaf is the last item in the chain.
Article last edited on: 2011-09-01 19:27:41
Did you find this article helpful? Yes No
How can we improve this article?