Home | History | Annotate | Download | only in lib

Lines Matching refs:tuning

63     /* Tuning arguments, kept in a physically separate structure.  */
64 const Hash_tuning *tuning;
128 /* Use this to initialize or reset a TUNING structure to
479 hash_reset_tuning (Hash_tuning *tuning)
481 *tuning = default_tuning;
505 /* For the given hash TABLE, check the user supplied tuning structure for
507 Otherwise, definitively reset the TUNING field to some acceptable default
509 tuning arguments), and return false. */
514 const Hash_tuning *tuning = table->tuning;
516 if (tuning == &default_tuning)
526 if (epsilon < tuning->growth_threshold
527 && tuning->growth_threshold < 1 - epsilon
528 && 1 + epsilon < tuning->growth_factor
529 && 0 <= tuning->shrink_threshold
530 && tuning->shrink_threshold + epsilon < tuning->shrink_factor
531 && tuning->shrink_factor <= 1
532 && tuning->shrink_threshold + epsilon < tuning->growth_threshold)
535 table->tuning = &default_tuning;
540 TUNING, or return 0 if there is no possible way to allocate that
544 compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
546 if (!tuning->is_n_buckets)
548 float new_candidate = candidate / tuning->growth_threshold;
565 the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
568 TUNING points to a structure of user-supplied values, in case some fine
569 tuning is wanted over the default behavior of the hasher. If TUNING is
570 NULL, the default tuning parameters are used instead. If TUNING is
594 hash_initialize (size_t candidate, const Hash_tuning *tuning,
609 if (!tuning)
610 tuning = &default_tuning;
611 table->tuning = tuning;
614 /* Fail if the tuning options are invalid. This is the only occasion
616 if the user provides invalid tuning options, we silently revert to
617 using the defaults, and ignore further request to change the tuning
622 table->n_buckets = compute_bucket_size (candidate, tuning);
939 occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
947 size_t new_size = compute_bucket_size (candidate, table->tuning);
961 new_table->tuning = table->tuning;
1064 > table->tuning->growth_threshold * table->n_buckets)
1066 /* Check more fully, before starting real work. If tuning arguments
1070 > table->tuning->growth_threshold * table->n_buckets)
1072 const Hash_tuning *tuning = table->tuning;
1074 (tuning->is_n_buckets
1075 ? (table->n_buckets * tuning->growth_factor)
1076 : (table->n_buckets * tuning->growth_factor
1077 * tuning->growth_threshold));
1166 < table->tuning->shrink_threshold * table->n_buckets)
1168 /* Check more fully, before starting real work. If tuning arguments
1172 < table->tuning->shrink_threshold * table->n_buckets)
1174 const Hash_tuning *tuning = table->tuning;
1176 (tuning->is_n_buckets
1177 ? table->n_buckets * tuning->shrink_factor
1178 : (table->n_buckets * tuning->shrink_factor
1179 * tuning->growth_threshold));