Is "Out of Memory" a recoverable error?

Robert Jacques sandford at jhu.edu
Wed Dec 3 12:50:30 PST 2008


On Wed, 03 Dec 2008 14:47:14 -0500, Robert Fraser  
<fraserofthenight at gmail.com> wrote:
> Robert Jacques wrote:
>> 2) One can still catch an error if need be.

Yeah, I'm not sure what I was thinking here.

> Not if the function is nothrow, since the function  never sets up an  
> exception handling frame (that's the point of this topic, AFAICT).

Okay, while we've been talking about OutOfMemoryError there's also  
RangeError, AssertError, FinalizeError and SwitchError and not allowing  
array indexing, contract programming or switches inside a nothrow function  
drastically reduces their usefulness (more so than allocation, in my  
opinion). So at least in debug mode, the handling frame (I think) exists  
in order to support RangeError and AssertError errors. However,  
SwitchError and HiddenFuncError occur in release code, so I'm not sure if  
nothrow functions will not have some error handling method. (I think  
FinalizeError is related to allocation and therefore OutOfMemoryError)

PS. I would class removing the exception handling frame as an optimization  
which is separate from the nothrow language contract feature.



More information about the Digitalmars-d mailing list