Ben Grasset <operato...@gmail.com> schrieb am Di., 16. Juli 2019, 00:13:
> On Mon, Jul 15, 2019 at 5:50 PM Michael Van Canneyt < > mich...@freepascal.org> wrote: > >> As far as I know, they are not. I believe that when specializing, the >> compiler checks if an identical specialization is in scope: >> if so, it uses that. If not, a duplicate is made. >> >> As far as I know, Delphi behaves the same. >> >> Michael. >> > > I was aware of the "identical specialization" check (or at least, I > assumed it worked that way.) > > It still seems to me though that while heavy use of generics is certainly > reflected in PPU size (for example, on x86_64 Windows, the release mode PPU > of Generics.Collections.pas with my build of FPC is slightly over 30 MB) > the PPU size does not really correspond to object file size or overall > binary size (which again might be thanks to some stage of FPC itself, or > the linker in the case of external ones, or both.) > > I suppose FPC does probably diverge from Delphi behavior at some point > there too, as Delphi uses only DCUs, with no separate ".O"s. > The *declaration* of a generic is reflected in the size of the PPU as the token stream is stored there. While *specializations* are reflected in the compiled object code, aka the .o file. Regards, Sven >
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel