Object.factory() and exe file size bloat
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Fri Aug 21 06:27:43 PDT 2015
On Friday, 21 August 2015 at 13:11:14 UTC, Iain Buclaw wrote:
>> If it is guaranteed, almost makes me want to abuse it for this:
>>
>> pragma(inline, true)
>> string foo()
>> {
>> if (!__ctfe)
>> assert(false);
>> // ...
>> }
>>
>> (for compilers other than LDC)
>>
>
> That enforces that foo() is always folded at compile time, not
> always
> inlined, no?
And when you combine both you gets function that is always folded
at compile time and does not bloat the generated object file
(like it happens right now with CTFE-only functions - they are
still emitted to the binary). Win.
Of course, with LDC it is not an issue because they got
--gc-sections working and CTFE utils get garbage collected :P
More information about the Digitalmars-d
mailing list