Linus with some good observations on garbage collection

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 29 09:30:59 PDT 2011


On 4/29/11 10:40 AM, Bruno Medeiros wrote:
> On 23/04/2011 15:45, Andrei Alexandrescu wrote:
>> On 4/23/11 8:57 AM, dsimcha wrote:
>>> BTW, since when does the ternary operator work with functions, as
>>> opposed to variables?
>>
>
> And that's since the C days btw. The function call is just an operation,
> the callee an operand, so any expression can be there.
>
>> They are converted to pointers to functions. Not something I'd recommend
>> because it makes the call slower.
>>
>> Andrei
>
> Hum, I didn't know that. Why does it make the call slower (other than
> the actual ternary operation), is it because it has to load the function
> address from a register/variable, instead of being a constant value?
> And/or not being able to inline the call?
> I mean, the first aspect seems like a very minor impact in performance,
> almost negligible.

It's an indirect call instead of a direct call.

Andrei


More information about the Digitalmars-d mailing list