Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am
Mo., 8. Nov. 2021, 15:31:

>
>
> > On Nov 8, 2021, at 1:27 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > And there you have it (simplified obviously). As long as the compiler
> can determine *at compile time* the code of the function (and the function
> is inlineable) it should in theory be able to inline it. This is true no
> matter if it's a function variable, a method variable (pointing to a
> non-virtual method) or an anonymous function. However if somewhere between
> passing in the function address and calling the function inlining does not
> work for one reason or the other (e.g. due to open array parameters which
> are currently not supported by inlining) then the compiler obviously can't
> inline the provided function either.
>
> Interesting, so the inlining the containing function is the key. I guess
> if the container were not inlined it would basically be like a generic
> where a new function body would be generated which contained the inline
> function pointers body with arguments replaced.
>

I don't know what you mean with "new function body". If a function is
inlined its code is contained within the surrounding function and if it's
not inlined then nothing changes.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to