malloc does not return null when out of memory

Mike Tancsa mike at sentex.net
Wed Jul 23 20:46:22 PDT 2003


At 08:15 PM 7/23/2003 -0700, Kris Kennaway wrote:
>On Wed, Jul 23, 2003 at 01:34:27PM -0400, Gabor wrote:
>
> > Here is the tail end of the output.  It dies when trying to poke at
> > the memory using memset.  If I just malloc without the memset, it
> > never even dies.
>
>Ah, the annual "memory overcommit" thread.  I thought we were overdue
>for one.


But why does the man page for malloc (3) say,

     If malloc() fails, a NULL pointer is returned.

         ---Mike
--------------------------------------------------------------------
Mike Tancsa,                          	          tel +1 519 651 3400
Sentex Communications,     			  mike at sentex.net
Providing Internet since 1994                    www.sentex.net
Cambridge, Ontario Canada			  www.sentex.net/mike



More information about the freebsd-stable mailing list