[fpc-pascal] inlining functions
M.Santhoff at t-online.de
Thu Oct 19 05:55:20 CEST 2006
when using "inline" on a procedure or function, does it completely avoid
the call by copying anything inside the "begin ... end" block to the
function anythingFunc(v: integer):real; inline;
... some calculations ...
function TMyObject.callAnything(v: integer):real;
result := anythingFunc(v);
This will result in two levels of calls (one for the method of TMyObject
and one from inside the method to the global function) without inlining.
I assume with inline on it is only *one* call, which would be a speed
improvement especially when called often.
Can someone confirm I understand this correctly?
More information about the fpc-pascal