10.8.4 inline

Procedures that are declared inline are copied to the places where they are called. This has the effect that there is no actual procedure call, the code of the procedure is just copied to where the procedure is needed, this results in faster execution speed if the function or procedure is used a lot.

By default, inline procedures are not allowed. Inline code must be enabled using the command-line switch -Si or {$inline on} directive.

  1. In old versions of Free Pascal, inline code was not exported from a unit. This meant that when calling an inline procedure from another unit, a normal procedure call will be performed. Only inside units, Inline procedures are really inlined. As of version 2.0.2, inline works accross units.
  2. Recursive inline functions are not allowed. i.e. an inline function that calls itself is not allowed.