On 1/12/2015 1:46 PM, Martin Nowak wrote:
There's another downside to returning two values - extra code is generated,
and it consumes another register. It allocates very scarce resources to rare
cases - not a recipe for high performance.

To defend that argument we'd first have to fix our own codegen.
https://issues.dlang.org/show_bug.cgi?id=12442

That issue has nothing to do with exception handling vs error codes.


It doesn't really consume the register, because the error value is only needed
directly after the call for a possible early return. But of course returning
tuples can be less efficient.

Yes, it does. Returning an int in EAX now becomes returning a pair [EAX,EDX].

Reply via email to