4.3.2. __attribute__((always_inline))

This function attribute indicates that a function must be inlined.

The compiler attempts to inline the function, regardless of the characteristics of the function. However, the compiler does not inline a function if doing so causes problems. For example, a recursive function is inlined into itself only once.

Note

This function attribute is a GNU compiler extension that is supported by the ARM compiler. It has the keyword equivalent __forceinline.

Example

static int max(int x, in y) __attribute__((always_inline))
{
    return x > y ? x : y; // always inline if possible
}

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential