[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] avoid memory reallocation

From: Michael W Thelen <mike_at_pietdepsi.com>
Date: 2005-08-18 19:06:54 CEST

SteveKing wrote:
> This is really a *very* little thing:
>
> The CL client uses an array to store all the auth providers. The initial
> size of that array is set to 10, but on Windows, there's one auth
> provider more so the array is always reallocated (or I'm counting wrong,
> could happen too).
> This very little patch takes care of this.

Pinging this patch... Brane objected, saying that it's not worth the
bother to change the initial size whenever a new auth provider is added.
 Steve responded that new auth providers are not added often, and the
initial size already seems to be intended to accommodate all auth
providers, which it doesn't quite do on Windows.

My (relatively ignorant) opinion is that if we're going to use a magic
number in the code (10), it might as well be large enough to accommodate
all auth providers on Windows (11), so the array doesn't need to be
reallocated. There are 11 calls to APR_ARRAY_PUSH in the code... the
array may as well be preallocated to 11, right? I don't see any
downsides to applying this patch. Are there any?

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 18 19:12:36 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.