httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Khrustalev <d...@xyzzy.machaon.ru>
Subject Re: calling pstrdup() on value before table_set?
Date Sun, 21 Dec 1997 05:09:21 GMT
> Oh interesting... I wasn't aware that table_set() duplicated the value
> behind the scenes as well.  Damn, these should all be cleaned up then.

Even worse, table_(set|merge|add) also duplicate keys.

> 
> Either that or the table_*() functions should be changed to not
> duplicate... I wonder which wastes less memory.  Not duplicating is likely
> to be a source of bugs though, because you have to allocate into the right
> pool. 

I'm running apache with non-duplicating table api since september with no ill
effects. ( using parallel non-duplicating table_(setn|mergen|addn) and copying
value argument where appropriate).
Performance improvement is quite measurable.

	-Dima

> 
> Dean
> 
> On Sat, 20 Dec 1997, Marc Slemko wrote:
> 
> > There are a number of cases in the code where something like:
> > 
> >     table_set(new->subprocess_env, "REDIRECT_STATUS", pstrdup(r->pool, t));
> > 
> > happens.  There is no reason for the pstrdup() except to waste memory is
> > there?
> > 
> > 





Mime
View raw message