Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2001 07:02:58 +1000
From:      Greg Black <gjb@gbch.net>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        seebs@plethora.net (Peter Seebach), freebsd-hackers@FreeBSD.ORG
Subject:   Re: Setting memory allocators for library functions. 
Message-ID:  <nospam-3a9821820a08191@maxim.gbch.net>
In-Reply-To: <9469.983047707@critter>  of Sat, 24 Feb 2001 21:48:27 %2B0100
References:  <9469.983047707@critter> 

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:

> In message <200102242043.f1OKhl618691@guild.plethora.net>, Peter Seebach writes
> :
> >In message <9402.983047348@critter>, Poul-Henning Kamp writes:
> >>>Well, no, but the sole available definition of "portable" says that it is
> >>>"portable" to assume that all the memory malloc can return is really
> >>>available.
> >
> >>No, this is not a guarantee.
> >
> >Yes, it is.  If the memory isn't available, malloc returns NULL.
> 
> The guarantee is "If malloc returns NULL there is no memory you can use".
> 
> That doesn't mean that just because != NULL is returned that memory
> will in fact be available.

If the intended behaviour of malloc is that it returns a pointer
to memory that is allocated but which may not be available when
accessed, the man page needs to be corrected to make this defect
in the implementation clear.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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