<div dir="ltr"><div dir="ltr">On Mon, Jul 15, 2019 at 5:50 PM Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
As far as I know, they are not. I believe that when specializing, the<br>
compiler checks if an identical specialization is in scope: <br>
if so, it uses that. If not, a duplicate is made.<br>
<br>
As far as I know, Delphi behaves the same.<br>
<br>
Michael.<br></blockquote><div><br></div><div>I was aware of the "identical specialization" check (or at least, I assumed it worked that way.) </div><div><br></div><div>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.)</div><div><br></div><div>I suppose FPC does probably diverge from Delphi behavior at some point there too, as Delphi uses only DCUs, with no separate ".O"s.</div></div></div>