Inlining is a great concept, and a potentially powerful optimization. Before using it, though, be sure to read Delphi's help about Inline.
Delphi 2006, for example, help has some very explicit things to say about inline. Among them:
- The inline directive is a suggestion to the compiler. It won't necessarily be observed.
- There are a number of cases in which inlining will not occur.
- Inlining will not occur on any form of late-bound method. This includes virtual, dynamic, and message methods.
- Routines that are not defined before use cannot be inlined.
- Routines that take open array parameters cannot be inlined.
- Procedures and functions used in conditional expressions in while-do and repeat-until cannot be expanded inline.
There are other limitations, so be sure to read Delphi help.
|