Disable or Decrease the Amount of Inlining

Inlining replaces a call to a function with the body of the function. This lets the compiler optimize the code for the inlined function in the context of its caller, usually yielding more specialized and better performing code. This also removes the overhead of calling the function at run-time.

However, replacing a call to a function by the code for that function usually increases code size. The code size increase can be substantial. To eliminate this code size increase, at the cost of the potential performance improvement, inlining can be disabled.

As an alternative to completely disabling inlining, the default amount of inlining can be decreased by using an inline factor less than the default value of 100. It corresponds to scaling the default values of the main inlining parameters by n%.

Options to specify:

To disable inlining:

Linux*: -fno-inline

Windows*: /Ob0

For further details about the compiler options, see the compiler option descriptions.

Advantages of this method:

Disabling or reducing this optimization can reduce code size.

Disadvantages of this method:

Performance is likely to be sacrificed by disabling or reducing inlining especially for applications with many small functions.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.