pike.git / src / stuff.c

version» Context lines:

pike.git/src/stuff.c:53:    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,   };    - /* Not all of these are primes, but they should be adequate */ - const INT32 hashprimes[32] = - { -  31, /* ~ 2^0 = 1 */ -  31, /* ~ 2^1 = 2 */ -  31, /* ~ 2^2 = 4 */ -  31, /* ~ 2^3 = 8 */ -  31, /* ~ 2^4 = 16 */ -  31, /* ~ 2^5 = 32 */ -  61, /* ~ 2^6 = 64 */ -  127, /* ~ 2^7 = 128 */ -  251, /* ~ 2^8 = 256 */ -  541, /* ~ 2^9 = 512 */ -  1151, /* ~ 2^10 = 1024 */ -  2111, /* ~ 2^11 = 2048 */ -  4327, /* ~ 2^12 = 4096 */ -  8803, /* ~ 2^13 = 8192 */ -  17903, /* ~ 2^14 = 16384 */ -  32321, /* ~ 2^15 = 32768 */ -  65599, /* ~ 2^16 = 65536 */ -  133153, /* ~ 2^17 = 131072 */ -  270001, /* ~ 2^18 = 264144 */ -  547453, /* ~ 2^19 = 524288 */ -  1109891, /* ~ 2^20 = 1048576 */ -  2000143, /* ~ 2^21 = 2097152 */ -  4561877, /* ~ 2^22 = 4194304 */ -  9248339, /* ~ 2^23 = 8388608 */ -  16777215, /* ~ 2^24 = 16777216 */ -  33554431, /* ~ 2^25 = 33554432 */ -  67108863, /* ~ 2^26 = 67108864 */ -  134217727, /* ~ 2^27 = 134217728 */ -  268435455, /* ~ 2^28 = 268435456 */ -  536870911, /* ~ 2^29 = 536870912 */ -  1073741823,/* ~ 2^30 = 1073741824 */ -  2147483647,/* ~ 2^31 = 2147483648 */ - }; +       /* Same thing as (int)floor(log((double)x) / log(2.0)), except a bit    quicker. Number of log2 per second:       log(x)/log(2.0) 50,000,000    log2(x) 75,000,000    Table lookup 3,000,000,000    Intrinsic 30,000,000,000,000,000   */