DIP56 Provide pragma to control function inlining
Joseph Cassman
jc7919 at outlook.com
Sun Feb 23 06:26:04 PST 2014
On Sunday, 23 February 2014 at 13:07:27 UTC, Dmitry Olshansky
wrote:
> 23-Feb-2014 16:57, Walter Bright пишет:
>> On 2/23/2014 4:25 AM, Tove wrote:
>>> The DIP should probably specify what happens if inlining
>>> fails,
>>> i.e. generate a compilation error.
>>
>> I suspect that may cause problems, because different compilers
>> will have
>> different inlining capabilities. I think it should be a
>> 'recommendation'
>> to the compiler.
>
> It's going to be near useless if it doesn't make sure inlining
> happened.
> Part of the reason for forced inline is always inlining some
> core primitives, even in debug builds.
>
> The other point is what Vladimir mentioned - we already doing
> micro-optimization, hence it better error out then turn a blind
> eye on our tinkering. I wouldn't not like to ever have to get
> down and look at ASM for every function just to make sure it
> was inlined.
That is most likely when I would make use of the concept too. And
a message from the compiler in its output telling me when such an
inline request failed would be helpful.
Joseph
More information about the Digitalmars-d
mailing list