httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject Re: Implementing split() on pipe buckets?
Date Sun, 12 Nov 2000 04:22:43 GMT

--- Cliff Woolley <> wrote:
> > I am also against some of the malloc checks.  In general in Apache, we do
> > not check for NULL after calling malloc, because if malloc returns NULL
> > your machine is basically screwed and we can't really fail cleanly anyway.
> I was just responding to the XXX comments.  If you don't think Apache should make
> these checks, no problem (since you're 100% right that the box is essentially
> fubar if malloc fails)... just nuke the XXX comments.

One other point about this: all of the rest of the bucket code checks for failed
mallocs.  Consistency is a Good Thing.  Besides, if there's some weird (but
recoverable) reason that malloc might fail on some quirky platforms (hypothetical
situation), then it seems that the Right thing to do would be to return the correct
apr_status_t value (APR_ENOMEM), rather than returning APR_SUCCESS if the function
really didn't succeed.  Note that a failure of malloc here might not turn up until
much later, and debugging it could be a huge hassle.  Of course, in normal
situations, malloc shouldn't fail unless you're flat out of memory, but why trust it
(and why bother having the APR_ENOMEM return code in the first place)?


Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!

View raw message