3 ms·
Checking the malloc return value doesn't always guarantee that you'll be OK. From the malloc man page (under BUGS): "By default, Linux follows an optimistic m
by tsandall 17y ago
Checking the malloc return value doesn't always guarantee that you'll be OK.
From the malloc man page (under BUGS):
"By default, Linux follows an optimistic memory allocation strategy. This means that when malloc() returns non-NULL there is no guarantee that the memory really is available."
It goes on to describe how this behavior can be turned off.