DIP56 - inlining

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 4 04:11:22 PST 2015


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.


More information about the Digitalmars-d mailing list