httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Marr <>
Subject RE: Four Apache-2.0 fixups
Date Wed, 12 Apr 2000 18:41:40 GMT
At 02:05 PM 04/12/2000, William A. Rowe, Jr. wrote:
>Since ordinals are significantly faster than searching the export 
>table for symbol names (sounds an awful lot like the ap_strcmp 
>issues :~) I decided to offer ordinals where they exist.

Have you done any speed tests for this assumption?  I've read that 
the symbol name lookup speed is now on par with ordinal resolution.

I assume that they're using some type of hash table lookup technique, 
much like what is used in linux for .so loading.  I have somewhere a 
copy of the algorithm that linux uses for hashing symbol names, which 
has been optimized quite a bit for generating an index from a 
character string.

Ah, I believe this is it:
int hash(char *string)
     unsigned long g, h = 0;

         h = (h << 4) + *string++;

         g = h & 0xF0000000L;

            h ^= g >> 24;

         h &= ~g;

     return(h % 0xFFFF);

Greg Marr
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"

View raw message