On Thu, Sep 27, 2012 at 8:50 AM, Adrian Chadd <[email protected]> wrote:
> .. I thought that malloc(.. , M_WAITOK) can return NULL. Wasn't there
> a discussion about this on IRC?
Shouldn't -- else it would break the API contract:
M_WAITOK
Indicates that it is OK to wait for resources. If the request
cannot be immediately fulfilled, the current process is put to
sleep to wait for resources to be released by other processes.
The malloc(), realloc(), and reallocf() functions cannot return
NULL if M_WAITOK is specified.
There was some discussion a little while ago IIRC about there being a
bug where it could return NULL, but that bug should really be quashed,
not disguised.
Thanks,
-Garrett
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"