httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] Enable sortable columns in FancyIndexed directories
Date Thu, 24 Jul 1997 07:55:34 GMT


On Wed, 23 Jul 1997, Alexei Kosut wrote:

> Or just
> 
> char qvalue = pstrdup(r->pool, "?.=.");
> 
> The Apache code actually uses that sort of construct a lot, probably
> uneccessarily in a lot of places. 

This is one of those unnecessary places.  Why allocate something that
lives beyond the end of the function when it's trivial to allocate it on
the stack?  (without imposing some compile time limitation on string
length) 

> But in this instance, this should work too (I think):
> 
> char qvalue[] = "?.=.";

This would perform the equivalent of a memcpy each time the function is
entered.  Whereas the method I gave initializes each element only once. 

Dean - performance freak



Mime
View raw message