[fpc-pascal] interfaces and smartpointers [was Traits Proposal]

Ryan Joseph genericptr at gmail.com
Wed Feb 17 17:37:23 CET 2021



> On Feb 17, 2021, at 8:27 AM, Benito van der Zander via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> var c: ITest;
> begin
>   c := TTest.Create(123);
>   c.println;

So this is where you're getting your performance penalties? Correct me if I'm wrong but two things happen here:

1) Implicit cast to ITest which does a runtime lookup (but there's interface name so no string comparison like Supports?)
2) calling "println" there is a call to a wrapper function (called "thunks")?

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list