You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/05/30 20:34:19 UTC

Re: Changed information for PR mod_proxy/614

On Fri, 30 May 1997, Jozsef Hollosi wrote:

> Dear Chuck:
> 
> You properly caught the small, but real memory leak in the patch I sent in,
> however, the just-released 1.2b11 has the leaked version of the path.
> Although it is a minor issue, because the whole leak is at most
> (2 * sizeof(char*))*MaxRequestsPerChild, which is just a few hundred bytes
> in most typical configurations, but you might still want to fix it for
> aesthetics.
> 
> Here is a suggested fix to the fix:
> 
> % diff proxy_util.c proxy_util.c.orig
> 704d703
> <     static char* charpbuf[2];
> 724c723
> <           hpbuf.h_addr_list = charpbuf;
> ---
> >           hpbuf.h_addr_list = malloc(2 * sizeof(char*));
> 

Is there a reason that proxy_util is using malloc instead of palloc?


Re: Changed information for PR mod_proxy/614

Posted by Dean Gaudet <dg...@arctic.org>.
On Fri, 30 May 1997, Chuck Murcko wrote:
> Yes. Managing just a few bytes didn't seem to call for the overkill of
> using palloc.

palloc is far cheaper than malloc... or rather it should be.  If it isn't
we need to rewrite it.  palloc doesn't keep any data that allows it to
free individual elements, and it gets some nice optimizations out of that.
malloc has more overhead.

I'd love to have an alloca that we could use though, but I forget why I
wanted that ;)

Dean


Re: Changed information for PR mod_proxy/614

Posted by Chuck Murcko <ch...@topsail.org>.
Marc Slemko wrote:
> 
> On Fri, 30 May 1997, Jozsef Hollosi wrote:
> 
> > Dear Chuck:
> >
> > You properly caught the small, but real memory leak in the patch I sent in,
> > however, the just-released 1.2b11 has the leaked version of the path.
> > Although it is a minor issue, because the whole leak is at most
> > (2 * sizeof(char*))*MaxRequestsPerChild, which is just a few hundred bytes
> > in most typical configurations, but you might still want to fix it for
> > aesthetics.
> >
> > Here is a suggested fix to the fix:
> >
> > % diff proxy_util.c proxy_util.c.orig
> > 704d703
> > <     static char* charpbuf[2];
> > 724c723
> > <           hpbuf.h_addr_list = charpbuf;
> > ---
> > >           hpbuf.h_addr_list = malloc(2 * sizeof(char*));
> >
> 
> Is there a reason that proxy_util is using malloc instead of palloc?

Yes. Managing just a few bytes didn't seem to call for the overkill of
using palloc.
-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org