Thursday, February 27, 2020

Digest for comp.programming.threads@googlegroups.com - 2 updates in 1 topic

aminer68@gmail.com: Feb 26 09:19AM -0800

Hello,
 
 
About C++ templates and Delphi generics and code bloat..
 
I have just read the following webpage about Delphi generics(that are like templates of C++) and code bloat:
 
https://boyet.com/blog/delphi-oriented-generics-or-what-a-dog/
 
 
I think Julian M Bucknall is way too pessimistic about Delphi, because
what that means is: if you have Unit1.pas and Unit2.pas and both are using TList<Integer> both Unit1.dcu and Unit2.dcu have the binary code for TList<Integer> compiled in, but only when compiling your binary the linker will remove duplicates. So i think Delphi is the same as C++, because notice that C++ also has code bloat with templates:
 
So read in the following it says:
 
"In C++ code bloat occurs because compilers generate code for all templated functions in each translation unit that use them. Back in the day the duplicate code was not consolidated resulting in "code bloat". These days the duplicate code can be removed at link time."
 
Read here:
 
https://stackoverflow.com/questions/24333345/how-does-template-cause-the-code-bloat-in-c
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 26 07:06PM +0100

> "In C++ code bloat occurs because compilers generate code for all templated functions in each translation unit that use them. Back in the day the duplicate code was not consolidated resulting in "code bloat". These days the duplicate code can be removed at link time."
 
"These days" - it has never been different !
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: