> I'm running this on a production machine that's taking around 55,000
> TCP connection an hour into a pair of squid's (machine is a PPro 200,
> with 448Meg of ram, and 18 gig of disk).
>
Your patch will break on SMP machines (fds_index isn't used atomically).
If you do want the caching, your code gets cleaner if you do it this way:
Allocate:
if(index)
data = cache[--index];
else
data = malloc();
Free:
if(index < SIZE_OF_CACHE)
cache[index++] = data;
else
free(data);
but you'll have to do some SMP locking.
-- Overeat: To dine. -- Ambrose Bierce, "The Devil's Dictionary"-- Matthias Urlichs \ noris network GmbH / Xlink-POP Nürnberg Schleiermacherstraße 12 \ Linux+Internet / EMail: urlichs@noris.de 90491 Nürnberg (Germany) \ Consulting+Programming+Networking+etc'ing PGP: 1024/4F578875 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE Click <A HREF="http://info.noris.de/~smurf/finger">here</A>. 42