apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ami Ganguli <hse_...@yahoo.co.uk>
Subject Re: precalculating hash values for apr_hash_t
Date Sat, 17 Apr 2004 16:48:51 GMT
 --- rbb@rkbloom.net wrote: > 
> How are you computing your pre-computed hash values?
>  Did you copy the hashing
> algorithm from APR's find_entry?  


> My biggest concern with this function is that the
> caller's hash function must
> agree with APR's hash function or the hash table
> won't work.  

Good point.

> A better approach to this, IMHO, is to create a new
> apr_hash_make function that
> allows a user to pass in a hash function.  This way,
> your program could
> pre-compute and cache the hash values.  When
> apr_hash_set or apr_hash_get are
> called, they will call your hashing function, which
> could then retrieve the
> correct value from the hash.

In fact, that would work quite nicely.  I'll work up a

... Ami.

Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 

View raw message