> perhaps i've been unclear.  i don't have any problem dealing with failed
> alloc.  malloc has always been able to return 0.
> 
> dealing with a page fault due to overcommit is a different story.

that's a slightly different aspect.  the note should not be "page fault" but
"out of memory" (or some such thing).  that's much better than a nil return.
most errors on shared resoruces are better expressed as exceptions (notes),
because that's what they are: they are a failure of the underlying physical or 
virtual machine
to handle an exceptional case.  the code shouldn't have to deal with it 
explicitly everywhere,
except in C to detect and propagate the exception to code that knows what's 
going on.

exceptions have acquired a bad name in some circles because of the way that some
people tried to use them for situations, usually in interfaces, that are hardly 
exceptional (eg, Ada and Java).

Reply via email to