System programming in D (Was: The God Language)

Iain Buclaw ibuclaw at ubuntu.com
Mon Jan 9 01:53:44 PST 2012


On 5 January 2012 11:40, Artur Skawina <art.08.09 at gmail.com> wrote:
> On 01/05/12 02:34, Iain Buclaw wrote:
>> Regardless, there is little reason to want to use a forced inline with
>> gdc.  Just like in c++ when you define all methods in the class
>> definition, gdc considers all methods as candidates for inlining.
>> Similarly, when -inline is passed, the same is also done for normal
>> functions that are considered inlinable by the frontend.  These
>> functions marked as inline are treated in the same way as a function
>> declared 'inline' in C or C++, and will be treated as such by the
>> backend.
>
> This reminded me:
>
> ------------------------------------
>
> IOW gdc completely gives up on inlining the function/method because of the "in".
> Actually, "bool empty2(T)(const T[] a)" is enough to trigger the call.
>
> This means that eg array.empty never gets inlined.
> "pragma(attribute, always_inline)" does not help in this case.
>
> artur

I have sorted this out.

Regards

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list