Object.factory() and exe file size bloat

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 21 03:59:20 PDT 2015


Am Thu, 20 Aug 2015 23:16:10 -0700
schrieb Walter Bright <newshound2 at digitalmars.com>:

> On 8/20/2015 11:00 PM, Mike wrote:
> > Ideally it would be nice to only pull in those ModuleInfo instances
> > that are actually needed in the program, and by association, only
> > pull in those TypeInfo instances needed by the ModuleInfo.  If no
> > ModuleInfo is used, and the associated TypeInfo is also not used,
> > then neither is pulled in.
> 
> I do plan to do a review of ModuleInfo with this in mind, but not
> immediately.
> 

Right now we use ModuleInfo to iterate all linked modules*. Keeping
modules but removing the ModuleInfo seems irreconcilable with that use case?
Of course completely removing a module could work.

*:
foreach(mod; ModuleInfo) is used in
* druntime to run unittests for all modules
* gdc druntime to find all modules with TLS variables for emulated TLS
  support
* IIRC also somehow used in dynamic shared library loading/unloading?


More information about the Digitalmars-d mailing list