removal of dead functions and methods

Kapps via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 24 07:10:17 PST 2014


On Wednesday, 24 December 2014 at 14:08:25 UTC, Dicebot wrote:
> On Wednesday, 24 December 2014 at 14:04:56 UTC, ketmar via 
> Digitalmars-d wrote:
>> Hello.
>>
>> i was never thinking about it, but recently i found parts of 
>> source
>> code in my compiled D binary. they comes from code generation
>> functions, which only used in compile time, yet still happily 
>> sits in
>> resulting binary. are there any plans to somehow "fix" that?
>
> LDC fixes that by using garbage collection of unused symbols by 
> default.

Does DMD/Optlink on Windows do this too? I've noticed that using 
DMD/Optlink on Windows, my executable is 4MB for unittests on a 
module that uses a lot of CTFE template methods, while with 
DMD/ld on Linux (and I believe GDC/ld as well), the same test 
executable is over 40MB.


More information about the Digitalmars-d mailing list