When compiling multiple source files

Timon Gehr timon.gehr at gmx.ch
Tue Aug 20 06:33:26 PDT 2013


On 08/20/2013 12:27 AM, ProgrammingGhost wrote:
>
> Is it possible that if I just try to compile 1 file it could imports
> enough libraries that import/need the definitions for additional large
> libraries which in turn also imports everything causing ram issues? I'm
> sure in practice this will almost never happen. But I don't doubt there
> are main libraries that use other large libraries and everything
> imports/uses everything
> ...

The compiler only has to pull in what is indispensable for semantically 
analyzing an imported module as far as to determine all relevant type 
signatures. So while it should be possible to create a project as large 
that the complete annotated syntax tree exhausts your RAM (projects are 
not that large in practice), it still would require careful construction 
of dependencies in order to actually exhaust RAM during separate 
compilation. (And it is much easier to do so by other means, eg. by 
instantiating templates in a loop.)


More information about the Digitalmars-d mailing list