httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: My oh my
Date Thu, 20 Apr 2000 23:49:45 GMT
> This makes me want to hurl.
> 
> >
> >   else {
> >        const char *errstr;
> >        SYS_ERR_STRING(statcode - APR_OS_START_SYSERR, p);
> >        return errstr;
> >    }

The macro isn't very neat, but what makes me hurl are the storage management
implications on platforms where APR will need to allocate storage from
p.  For an APR app like Apache, it isn't a big deal because most pools
are short-lived.  I don't like the idea that I can't write an APR app
which lives forever which writes log messages from time to time unless
I artificially create and destroy a pool so that I don't suffer from a
storage leak.  (There are other certainly other parts of APR which
behave similarly; in most cases (hopefully) it makes sense to do so.
I imagine that any remaining cases (e.g., ap_poll()) are just bugs
waiting to be fixed and not cases where pool growth is a sacred design
principle.) 

Can I pass NULL for the pool and then free() the string when I'm done?
Maybe, maybe not...  Probably it would be better to either always
malloc() or perhaps better yet, always malloc() if pool is NULL so
that apps that don't need a short-lived pool for any other reason
won't have to create one for this.

(I'm not saying that my interface was pretty but at least it wouldn't
affect certain types of apps in a negative way.)

Have fun,

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message