Why exceptions for error handling is so important

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 12 16:51:38 PST 2015


On Tuesday, 13 January 2015 at 00:05:31 UTC, Walter Bright wrote:
> On 1/12/2015 3:17 PM, deadalnix wrote:
>> On Monday, 12 January 2015 at 22:17:57 UTC, Walter Bright 
>> wrote:
>>> Yes, it does. Returning an int in EAX now becomes returning a 
>>> pair [EAX,EDX].
>>
>> It is not that big of a deal, EDX is a trash register anyway 
>> if memory serve,
>> but then, it become very bad when it do not fit in register 
>> anymore.
>
> Returning a slice, for example, already consumes EAX and EDX. 
> Adding an error code pushes that into returning via a pointer 
> to a stack temporary.
>
> Also, there's the code needed to load the value into EDX in the 
> first place.
>
> It adds up.

Quoting myself:

> it become very bad when it do not fit in register anymore.

So we agree :)


More information about the Digitalmars-d mailing list