[fpc-devel] [Suggestion] Enumeration range-check intrinsic
Ben Grasset
operator97 at gmail.com
Tue Jul 16 16:25:21 CEST 2019
On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <
fpc-devel at lists.freepascal.org> wrote:
> The output will then be two different addresses, thus showing that the
> code had been generated twice.
>
> However the compiler/linker is good at leaving out unused code and in this
> case only the two Assign specializations are kept as their addresses are
> taken, everything else is discarded. If you'd change one of the two to
> another non-virtual method then Assign of the one specialization and the
> other method of the other specialization would be kept.
>
> If you use virtual methods inside generics then things are less likely to
> be removed.
>
Ah, I understand now.
I guess my point overall was that, in my experience at least, while there's
indeed probably room for improvement in that area via something like WPO /
COMDAT support / e.t.c. as you'd suggested, the overall effect of generics
in FPC on binary size is not *unreasonable*.
I use Delphi only semi-regularly, but it does seem to be somewhat more of
an actual issue there (as frankly binary size in recent Delphis is in
general, with generics or not, when compared to FPC.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190716/03221d4f/attachment.html>
More information about the fpc-devel
mailing list