Contents    Page-10    Prev    Next    Page+10    Index   

Function Inlining

Inlining is the expansion of the code of a function at the point of call. If the code says sqrt(x), sqrt can be invoked as a closed function in the usual way, or it can be expanded as an open or inline function by expanding the definition of sqrt at each point of call.

Inline expansion saves the overhead of subroutine call and parameter transmission; it may allow additional optimization because the compiler can now see that certain things (including types) are constant.

If code is in the form of abstract syntax trees, inlining is easy: