<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> schrieb am Di., 16. Juli 2019, 16:31:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Tue, 16 Jul 2019, Ben Grasset wrote:<br>
<br>
> On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <<br>
> <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> wrote:<br>
><br>
>> The output will then be two different addresses, thus showing that the<br>
>> code had been generated twice.<br>
>><br>
>> However the compiler/linker is good at leaving out unused code and in this<br>
>> case only the two Assign specializations are kept as their addresses are<br>
>> taken, everything else is discarded. If you'd change one of the two to<br>
>> another non-virtual method then Assign of the one specialization and the<br>
>> other method of the other specialization would be kept.<br>
>><br>
>> If you use virtual methods inside generics then things are less likely to<br>
>> be removed.<br>
>><br>
><br>
> Ah, I understand now.<br>
><br>
> I guess my point overall was that, in my experience at least, while there's<br>
> indeed probably room for improvement in that area via something like WPO /<br>
> COMDAT support / e.t.c. as you'd suggested, the overall effect of generics<br>
> in FPC on binary size is not *unreasonable*.<br>
><br>
> I use Delphi only semi-regularly, but it does seem to be somewhat more of<br>
> an actual issue there (as frankly binary size in recent Delphis is in<br>
> general, with generics or not, when compared to FPC.)<br>
<br>
I suspect this is also in part due to the liberal and generous use of extended RTTI.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Correct. We'll have to see how that works out with FPC... </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>