Donald Sharp <[EMAIL PROTECTED]> writes: > Although looking at the xmalloc call, I don't know if it's such a good > thing for it to take a 0 length request and turn it into a 1 byte > request. Why would we need to ask for a 0 length portion of memory? malloc of 0 bytes on some platforms returns NULL. xmalloc never returns NULL. This is the entire point and purpose of xmalloc; you call xmalloc because you don't ever want to deal with malloc returning NULL pointers. Either you get a valid pointer back or the program terminates. Allowing xmalloc to return NULL even for a special case would, in my opinion, violate a key portion of its semantics. -- Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/>
- question (preference?) about xmalloc Noel L Yap
- Re: question (preference?) about xmalloc Larry Jones
- Re: question (preference?) about xmalloc Donald Sharp
- Re: question (preference?) about xmalloc Russ Allbery
- Re: question (preference?) about xmalloc Michael Gersten
- Re: question (preference?) about xmalloc Greg A. Woods
- Re: question (preference?) about xmalloc David Thornley
- Re: question (preference?) about xmalloc Derek Scherger
- Re: question (preference?) about xmalloc Jonathan M. Gilligan
- Re: question (preference?) about xmalloc David Thornley
- Re: question (preference?) about xmalloc Noel L Yap
- Re: question (preference?) about xmalloc Donald Sharp
- Re: question (preference?) about xmalloc Larry Jones
- Re: question (preference?) about xmalloc Noel L Yap
