Re: malloc's out-of-memory error handling

From: Stefan Monnier (monnier_at_iro.umontreal.ca)
Date: 07/02/04


Date: Fri, 02 Jul 2004 17:58:38 GMT


>> If my test program tries to access the memory address returned from
>> malloc it receives a kill signal (which can't be handled).
>> Any (simple) ideas how to realize that there is no more physical memory
>> availabel, so my program can terminate with an out-of-memory error
>> instead of being killed?

> The C standard says that such behaviour is not allowed.

Interesting. I never noticed that it disallows it. Do you remember which
part of the standard disallows it?

        Stefan