On Mon, 18 Jan 1999, Matthew Dillon wrote:

> :> > There was some talk about the fact that malloc(..M_CANWAIT)
> :> > can now return with a failure. Is that true?
> :> 
> :> Yes; it's necessary to do this to allow some chance of avoiding 
> :> deadlock.
> :
> :Ouch! Is everything in src-sys already checking the return value of an 
> M_WAITOK?
> :
> : Brian Feldman                                         _ __  ___ ___ ___  
> 
>     It looks like malloc() can return NULL if the kmem_malloc() fails.
> 
>     kmem_malloc() can only fail in the M_WAITOK case if the KVM map is full.
>     If the system is simply low on memory, kmem_malloc() will block.
> 
>     So malloc() will generally not return NULL even in low memory situations
>     unless the KVM map fills up, which isn't supposed to happen but can in
>     certain severe circumstances.  Callers should therefore check for NULL.

why not just put it in a loop and block on lbolt?
(or call panic)
the trouble is that this is a major change in semantics and will affect
code flow all over the place.

julian


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to