Keil™, An ARM® Company

RealView Compiler User's Guide

Inlining

4.4. Inlining

Inlining of functions offers a trade-off between code size and performance. By default, the compiler decides for itself whether to inline code or not. As a general rule, the compiler makes sensible decisions about inlining with a view to producing code of a minimal size. This is because code size for embedded systems is a major issue.

In most circumstances, the decision to inline a particular function is best left to the compiler. However, you can give the compiler a hint that an inline function is required by using the __inline keyword (in C) or inline keyword (in C++). It also offers a range of other facilities for modifying its behavior with respect to inlining. There are several factors you must take into account when deciding whether to use these facilities, or more generally, whether to inline a function at all.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0375A