digitalmars.D.learn - Release binary
- Vladimir Voinkov (4/4) Jul 10 2009 I've noticed that constant strings are still presented in release bynary...
- Don (4/10) Jul 13 2009 No, the DMD linker isn't smart enough. (Maybe the LDC one is?)
I've noticed that constant strings are still presented in release bynary: static invariant string Abc0 = "abcdefg"; static const string Abc1 = "abcdefg"; A source compiles with -O -release and the strings are not referenced. Is linked able to optimize them out?
Jul 10 2009
Vladimir Voinkov wrote:I've noticed that constant strings are still presented in release bynary: static invariant string Abc0 = "abcdefg"; static const string Abc1 = "abcdefg"; A source compiles with -O -release and the strings are not referenced. Is linked able to optimize them out?No, the DMD linker isn't smart enough. (Maybe the LDC one is?) BTW that's why D2 has 'enum' for manifest constants. It's a language hack to work around a linker limitation.
Jul 13 2009