"strtr" <st...@sp.am> wrote in message news:i1lro6$307...@digitalmars.com... > == Quote from bearophile (bearophileh...@lycos.com)'s article >> strtr: >> > Not that the memory is really significant compared to the rest of my >> > program, >> > but I have a few fairly large arrays I use only in compile time and I >> > was >> > wondering why dmd still includes those in the executable (simple text >> > search >> > dug them up). >> Are you able to create a smallish test case? >> Bye, >> bearophile > > ---- > module main; > > const char[] CT_STRING = "int i=0;"; > > void main(){ > mixin( CT_STRING ); > } > ---- > The string can be found in the executable. >
I think if you use enum instead of const/immutable the compiler is not meant to put them in the executable (it might anyway in some/all cases). eg. module main; enum CT_STRING = "int i=0;"; void main(){ mixin( CT_STRING ); }