Noel L Yap writes:
>
> I was looking at that, too.  I tend to feel that 0-byte allocations should be
> allowed (returning NULL) and, if systems' frees don't handle NULL properly,
> there should be an xfree() that'll do so.

The problem with that is that code that calls malloc almost always
assumes that a NULL return means there's no more memory available and
thus errors out.  Interpreting 0-byte requests as 1-byte requests
ensures that you don't get a NULL return unless you really are out of
memory and, as an extra added attraction, you don't have to wrap free.

-Larry Jones

It's not denial.  I'm just very selective about the reality I accept.
-- Calvin

Reply via email to