Inline ExpansionInlining

suggest change

Inline expansion (also known as inlining) is compiler optimisation that replaces a call to a function with the body of that function. This saves the function call overhead, but at the cost of space, since the function may be duplicated several times.

// source:

int process(int value)
{
    return 2 * value;
}

int foo(int a)
{
    return process(a);
}

// program, after inlining:

int foo(int a)
{
    return 2 * a; // the body of process() is copied into foo()
}

Inlining is most commonly done for small functions, where the function call overhead is significant compared to the size of the function body.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents