httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: fprintf(stderr in Apache and APR.
Date Thu, 18 Nov 1999 12:13:59 GMT
On Thu, 18 Nov 1999, Ryan Bloom wrote:
>...
> > i know errors are a pain in the ass to return in certain cases, such as
> > fork()/exec()... see "lazy" :)
> 
> I don't have any problem returning errors, I just want to make sure we do
> it with the least amount of pain to our users.

-1 on returning errors from the memory allocators. No way do I want to
start checking every one of those. eesh!

If somebody wants to use APR in a context other than Apache, and they want
errors from the allocators, then I might suggest a flag in the context
that states whether to exit on alloc failure or to return a failure. This
allows Apache and its modules to continue on its current pattern: no need
to check for alloc failure.
[ this, along with cleanup makes memory handling livable in Apache ]

The problem with changing the allocators to return a status is simply the
obfuscation caused by that. In other words:

s2 = ap_pstrdup(s1, p);

must become:

status = ap_pstrdup(&s2, s1, p);


Icky.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message