DIP56 Provide pragma to control function inlining

Dicebot public at dicebot.lv
Mon Feb 24 06:03:34 PST 2014


On Monday, 24 February 2014 at 01:09:46 UTC, Araq wrote:
> Do you mind to back up your "fact" with some numbers? Afaict 
> 'inline' is more common than __attribute__((forceinline)). 
> (Well ok for C code #define is even more common, but most C 
> code is stuck in the 70ies anyway so that doesn't mean 
> anything.)

I can't link you closed projects I have been working on before so 
you can surely not trust my memories. Normal `inline` is common 
in headers because you can't have non-inlined function bodies in 
headers. In actual translation units - only from those who 
actually expect it to have forceinline effect (I have not met a 
single case where adding it can make any difference on gcc 
decision to inline or not). This was my actual point - not that 
no one uses "inline" but that the very same lax definition has 
turned it into essentially into no-op, causing necessity for 
compiler-specific alternative to appear.


More information about the Digitalmars-d mailing list