malloc does not return null when out of memory

Darryl Okahata darrylo at soco.agilent.com
Wed Jul 23 15:22:34 PDT 2003


Barney Wolff <barney at databus.com> wrote:

> Shouldn't malloc return 0 when out of memory rather than returning
> an address that won't work?  I believe that was the complaint.  Presumably
> having NO_SWAPPING has something to do with it, but filling the swap
> might well do the same thing.

     Well, it goes against the man page, but FreeBSD typically never
returns NULL [*] when you run out of VM.  It's been this way for YEARS.

[*] -- Yes, it's annoying as h*ll, but that's the way it works.  I
       thought that there was a FAQ or handbook entry on this, but I
       couldn't find any.

-- 
	Darryl Okahata
	darrylo at 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.


More information about the freebsd-stable mailing list