You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by sridhar basam <sr...@basam.org> on 2011/12/05 19:52:44 UTC
APR hash vs httpd implementation
Anyone know why the mod_cache code has an almost identical implementation
of the apr_hash* functions? Seems like the only difference is that the
mod_cache implementation isn't using APR pools and has a fixed size table.
Are there any advantages using one over the other?
thanks,
Sridhar
Re: APR hash vs httpd implementation
Posted by Graham Leggett <mi...@sharp.fm>.
On 05 Dec 2011, at 8:52 PM, sridhar basam wrote:
> Anyone know why the mod_cache code has an almost identical implementation of the apr_hash* functions? Seems like the only difference is that the mod_cache implementation isn't using APR pools and has a fixed size table. Are there any advantages using one over the other?
svn blame shows this:
------------------------------------------------------------------------
r94932 | stoddard | 2002-05-04 21:54:39 +0200 (Sat, 04 May 2002) | 5 lines
Introduce a dedicated cache hash adt that does not rely on pools. This
cures a storage leak when garbage collecting expired entries out of the
hash table. cache_hash is just apr_hash with some of the function removed
and reimplemented to use malloc/free in place of apr_pool calls.
Turns out to be dead code at this point that used to be used by the now-removed mod_mem_cache.
Regards,
Graham
--
Re: APR hash vs httpd implementation
Posted by Greg Stein <gs...@gmail.com>.
I think that question is best answered by the people who develop
mod_cache, aka dev@httpd.apache.org.
That said, I'll offer a guess: that is along-lived hash table that
will see plenty of churn over time. An APR hash table would continue
to grow and consume memory, but you really don't want that to occur in
mod_cache. Thus, to keep memory reasonably constrained, it avoids
using pools.
Cheers,
-g
On Mon, Dec 5, 2011 at 13:52, sridhar basam <sr...@basam.org> wrote:
>
> Anyone know why the mod_cache code has an almost identical implementation of
> the apr_hash* functions? Seems like the only difference is that the
> mod_cache implementation isn't using APR pools and has a fixed size table.
> Are there any advantages using one over the other?
>
> thanks,
> Sridhar
Re: APR hash vs httpd implementation
Posted by Greg Stein <gs...@gmail.com>.
I think that question is best answered by the people who develop
mod_cache, aka dev@httpd.apache.org.
That said, I'll offer a guess: that is along-lived hash table that
will see plenty of churn over time. An APR hash table would continue
to grow and consume memory, but you really don't want that to occur in
mod_cache. Thus, to keep memory reasonably constrained, it avoids
using pools.
Cheers,
-g
On Mon, Dec 5, 2011 at 13:52, sridhar basam <sr...@basam.org> wrote:
>
> Anyone know why the mod_cache code has an almost identical implementation of
> the apr_hash* functions? Seems like the only difference is that the
> mod_cache implementation isn't using APR pools and has a fixed size table.
> Are there any advantages using one over the other?
>
> thanks,
> Sridhar