On 9/4/07, erik quanstrom <quanstro@coraid.com> wrote:
On Tue Sep  4 09:39:37 EDT 2007, leimy2k@gmail.com wrote:

> Yep, I've seen code with totally erroneous use of realloc work perfectly on
> Linux for example, due to it's behavior.  Then I built it on FreeBSD and it
> failed appropriately :-).

what does this have to do with memory overcommitment?  k&r second ed,
p. 252 specifies that malloc and realloc return NULL if the request can't
be specified.

- erik

Plenty if I shared the code with you... :-)  Has to do with what memory was allocated vs what was being used. 

Unfortunately I'm not at liberty to post such code.

 
Let's just say it shouldn't have returned NULL in this case (to my recollection).  Different OSes behave differently with what is committed via the allocation functions of stdlib.  I'm thinking they're creeping into undefined behavior territory of the standard rather than modes that are explicitly supposed to fail.

Dave