Inline

From Lazarus wiki
Revision as of 09:27, 25 January 2021 by Thaddy (talk | contribs)

Deutsch (de) English (en)


Return to Reserved words.


The reserved word inline allows the compiler to copy a function or procedure in place of its call.

If the inline function or procedure is used frequently, this increases the speed of the program since the program does not have to branch to the subroutine.

The use of inline functions and inline procedures is switched off as standard. The compiler switch -Si or {$inline on} enables the use of inline functions and procedures.

Warning-icon.png

Warning: inline is a compiler hint and the compiler can ignore it. If the compiler warns you it has not inlined a certain code part marked as inline, you should remove the inline directive. This is not a bug. It is about code complexity


Example:

procedure subDemo(); inline;
  begin
  ...
  end;