Object.factory() and exe file size bloat

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 22 12:11:00 PDT 2015


Am Sat, 22 Aug 2015 14:47:34 +0200
schrieb Iain Buclaw via Digitalmars-d <digitalmars-d at puremagic.com>:

> On 22 August 2015 at 11:33, Johannes Pfau via Digitalmars-d <
> digitalmars-d at puremagic.com> wrote:
> 
> > Am Fri, 21 Aug 2015 15:16:01 +0200
> > schrieb Iain Buclaw via Digitalmars-d <digitalmars-d at puremagic.com>:
> >
> > >
> > > Other than that, the semantics of pragma(inline, true) should
> > > guarantee that the function is never *written* to object file.
> > >
> >
> > This really should be documented then. If we build a shared library
> > with pragma(inline) functions not emitting the function prevents
> > taking the address of that function in all client code. As this is
> > a breaking change to 'normal' inline semantics it needs to be
> > documented.
> >
> > https://github.com/D-Programming-Language/dlang.org/pull/1073
> >
> 
> I wouldn't go as far as preventing these functions from having their
> address taken.  In that instance, of *course* it needs to be written
> to object file.  But it should be put in COMDAT as each external
> module that takes its address will have a copy of it.
> 
> Regards
> Iain.
> 

That's indeed a better solution.


More information about the Digitalmars-d mailing list