Extern inline functions in ARM C++

10.12 Extern inline functions in ARM C++

The ISO C++ Standard requires inline functions to be defined wherever you use them. To prevent the clashing of multiple out-of-line copies of inline functions, the C++ compiler emits out-of-line extern functions in common sections.

Out-of-line inline functions

The compiler emits inline functions out-of-line, in the following
cases:

The heuristic that is used by the compiler decides that it is better not to
inline the function. -Ospace and -Otime influence the heuristic. If you use -Otime, the compiler inlines more functions. You can override
this heuristic by declaring a function with __forceinline. For example:

__forceinline int g()
{
return 1;
}

Note

__forceinline does not guarantee the function is inlined, since the decision ultimately
lies with the compiler. Using __forceinline provides a hint, telling the compiler to inline
the function if possible.

Important information

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.