svn commit: r240993 - head/sys/cam/ctl
Garrett Cooper
yanegomi at gmail.com
Thu Sep 27 16:19:14 UTC 2012
On Thu, Sep 27, 2012 at 8:50 AM, Adrian Chadd <adrian at freebsd.org> 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
More information about the svn-src-head
mailing list