[fpc-pascal] interfaces and smartpointers [was Traits Proposal]
Sven Barth
pascaldragon at googlemail.com
Thu Feb 18 22:47:39 CET 2021
Am 18.02.2021 um 02:25 schrieb Ryan Joseph via fpc-pascal:
>
>> On Feb 17, 2021, at 4:51 PM, Benito van der Zander via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>>
>> I benchmarked it years ago, I do not remember the details.
>>
>> But InitInterfacePointers was bad. Just look at it:
>>
> That's not great for sure. Fillchar could be a big culprit also actually. I for one would like I way to disable that for special circumstances.
You can in theory circumvent this by overriding NewInstance for some
class though you'll have to reimplement essentially the whole of
TObject.InitInstance.
> I don't Lazarus usually and I can't get the debugger to work on my Mac so tried Compiler Explorer. Not seeing the method calls here though.
The whole class instantiation except for the allocation is hidden in
TObject.InitInstance.
Regards,
Sven
More information about the fpc-pascal
mailing list