DIP56 - inlining

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 4 05:12:38 PST 2015


Am Wed, 04 Feb 2015 04:11:22 -0800
schrieb Walter Bright <newshound2 at digitalmars.com>:

> On 2/4/2015 4:08 AM, Walter Bright wrote:
> > On 2/4/2015 3:08 AM, Johannes Pfau wrote:
> >> The compiler will still have to
> >> generate a complete function which takes up space in the object
> >> file.
> >
> > Space in the object file is not important, space in the executable
> > is. It's the linker's job to remove unreferenced functions (dmd
> > places each function in its own section for that and other
> > reasons). If the linker falls down on that job, an alternative is
> > to use dmd to generate a library, where it will generate one object
> > in the library per function. Then, the linker will only pull
> > objects out of the library that are actually referenced.
> 
> Forgot to mention, you could also use string mixins.

OK, I just said the DIP should make that clear. I'm not going to
discuss this any further it's just wasted time.


More information about the Digitalmars-d mailing list