On the richness of C++

Bruno Medeiros brunodomedeiros+spam at com.gmail
Sun Apr 27 08:04:15 PDT 2008


Sean Kelly wrote:
> == Quote from Sean Kelly (sean at invisibleduck.org)'s article
>> == Quote from Janice Caron (caron800 at googlemail.com)'s article
>> I think the problem is that functions and delegates are called differently.
>> That is, the context pointer is passed as an invisible first parameter to
>> a delegate, while functions have no such invisible argument.  Interestingly,
>> because the first parameter of a D function is supposed to be passed in a
>> register (EAX) on x86, I think you're right that it should be possible to
>> allow such efficient conversion so long as the D calling convention
>> accounts for it properly (and the platform supports such things).
> 
> Er... forget that.  A D function would obviously expect its first argument to
> be in EAX regardless of whether it's a delegate.  Some conversion would be
> necessary unless I'm missing something.
> 
> 
> Sean

Well, if that doesn't work, there is nothing preventing the *changing* 
the D function calling ABI, right? Or are there some performance, or 
other issues?

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list