• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/dyld-353.2.1/include/

Lines Matching defs:smax

761 predetermined mapping of 0..255 into 0..smax-1.  *tab* is an
877 /* initialize scramble[] with distinct random values in 0..smax-1 */
878 static void scrambleinit(ub4 *scramble, ub4 smax)
880 // ub4 smax; /* scramble values should be in 0..smax-1 */
884 /* fill scramble[] with distinct random integers in 0..smax-1 */
887 scramble[i] = permute(i, log2u(smax));
934 static void initnorm(key *keys, ub4 nkeys, ub4 alen, ub4 blen, ub4 smax, ub8 salt)
938 // ub4 smax; /* maximum range of computable hash values */
1031 static int augment(bstuff *tabb, hstuff *tabh, qstuff *tabq, ub4 blen, ub4 *scramble, ub4 smax, bstuff *item, ub4 nkeys,
1038 // ub4 smax; /* highest value in scramble */
1046 ub4 highhash = smax;
1114 static int perfect(bstuff *tabb, hstuff *tabh, qstuff *tabq, ub4 blen, ub4 smax, ub4 *scramble, ub4 nkeys)
1120 fprintf(stderr, " blen %d smax %d nkeys %d\n", blen, smax, nkeys);
1124 memset((void *)tabh, 0, sizeof(hstuff)*smax);
1135 if (!augment(tabb, tabh, tabq, blen, scramble, smax, &tabb[i], nkeys,
1147 static void initalen(ub4 *alen, ub4 *blen, ub4 smax, ub4 nkeys)
1150 // ub4 smax; /* input, power of two greater or equal to max hash value */
1157 * If smax<256 there is no scramble, so tab[b] needs to cover 0..smax-1.
1162 * alen must be less than smax, in fact less than nkeys, because otherwise
1168 * It takes around 800 trials to find distinct (a,b) with nkey=smax*(5/8)
1169 * and alen*blen = smax*smax/32.
1171 * Values of blen less than smax/4 never work, and smax/2 always works.
1176 * When nkey <= smax*(5/8), blen=smax/4 works much more often with
1177 * alen=smax/8 than with alen=smax/4. Above smax*(5/8), blen=smax/4
1178 * doesn't seem to care whether alen=smax/8 or alen=smax/4. I think it
1187 *alen = smax; /* no reason to restrict alen to smax/2 */
1188 *blen = ((nkeys <= smax*0.6) ? smax/16 :
1189 (nkeys <= smax*0.8) ? smax/8 : smax/4);
1195 fprintf(stderr, "alen %d blen %d smax %d nkeys %d\n", *alen, *blen, smax, nkeys);
1205 ub4 *scramble, ub4 smax, key *keys, ub4 nkeys)
1211 // ub4 smax; /* input, scramble[i] in 0..smax-1 */
1223 initalen(alen, blen, smax, nkeys);
1225 scrambleinit(scramble, smax);
1227 maxalen = smax;
1232 tabh = new hstuff[smax];
1243 initnorm(keys, nkeys, *alen, *blen, smax, *salt);
1255 else if (*blen < smax)
1270 if (!perfect(*tabb, tabh, tabq, *blen, smax, scramble, nkeys))
1274 if (*blen < smax)
1330 ub4 smax; /* scramble[] values in 0..smax-1, a power of 2 */
1343 smax = ((ub4)1<<log2u(nkeys));
1345 scramble, smax, keys, nkeys);
1347 smax = 2 * ((ub4)1<<log2u(nkeys));
1349 scramble, smax, keys, nkeys);
1355 result.capacity = smax;