Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2003 10:34:37 -0700
From:      Darryl Okahata <darrylo@soco.agilent.com>
To:        freebsd-stable@freebsd.org
Subject:   Re: malloc does not return null when out of memory 
Message-ID:  <200307241734.KAA04726@mina.soco.agilent.com>
In-Reply-To: Your message of "Thu, 24 Jul 2003 16:49:34 %2B1000." <3F1F817E.7040504@bigpond.net.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Reilly <areilly@bigpond.net.au> wrote:

> Mike Tancsa wrote:
> 
> >> 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.
> 
> Because that's what happens.  See the subthread with the ulimit examples.

     You know, we could probably eliminate many of these periodic "why
doesn't malloc() return NULL?" threads by simply enhancing the malloc(3)
man page and adding a FAQ entry.

-- 
	Darryl Okahata
	darrylo@soco.agilent.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Agilent Technologies, or
of the little green men that have been following him all day.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307241734.KAA04726>