src/tools/tracepp/jhash.h
/* A special optimized version that handles 1 or more of u32s.
 * The length parameter here is the number of u32s in the key.
 */
A special optimized version that handles 1 or more of u32s.
The length parameter here is the number of u32s in the key.
A special optimized version that handles 1 or more of u32s . The length parameter here is the number of u32s in the key .
static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
{
    u32 a, b, c, len;
    a = b = JHASH_GOLDEN_RATIO;
    c = initval;
    len = length;
    while (len >= 3) {
        a += k[0];
        b += k[1];
        c += k[2];
        __jhash_mix(a, b, c);
        k += 3; len -= 3;
    }
    c += length * 4;
    switch (len) {
        case 2 : b += k[1];
        case 1 : a += k[0];
    };
    __jhash_mix(a,b,c);
    return c;
}
static inline u32 jhash2 ( const u32 * k , u32 length , u32 initval ) { u32 a , b , c , len ; a = b = JHASH_GOLDEN_RATIO ; c = initval ; len = length ; while ( len >= 3 ) { a += k [ 0 ] ; b += k [ 1 ] ; c += k [ 2 ] ; __jhash_mix ( a , b , c ) ; k += 3 ; len -= 3 ; } c += length * 4 ; switch ( len ) { case 2 : b += k [ 1 ] ; case 1 : a += k [ 0 ] ; } ; __jhash_mix ( a , b , c ) ; return c ; }
A special optimized version that handles 1 or more of u32s.
A special optimized version that handles 1 or more of u32s .