> On modern operating systems, allocations only return zero when you exhaust > virtual memory. Returning nonzero doesn't mean you have enough memory, > because it's given you a redundant copy on write mapping of the zero page > and will fault in physical pages when you write to 'em, which has _no_ > return value. Instead, the out of memory killer will shoot your program in > the head in the middle of it's run
Decent operating systems allow the system administrator gets to choose how optimistic memory allocation is. You're describing wildly-optimistic mode, which is often but not always the default. Paul