Home | History | Annotate | Download | only in lib

Lines Matching refs:candidate

440 /* Return true if CANDIDATE is a prime number.  CANDIDATE should be an odd
444 is_prime (size_t candidate)
449 while (square < candidate && (candidate % divisor))
456 return (candidate % divisor ? true : false);
459 /* Round a given CANDIDATE number up to the nearest prime, and return that
463 next_prime (size_t candidate)
466 if (candidate < 10)
467 candidate = 10;
470 candidate |= 1;
472 while (SIZE_MAX != candidate && !is_prime (candidate))
473 candidate += 2;
475 return candidate;
539 /* Compute the size of the bucket array for the given CANDIDATE and
544 compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
548 float new_candidate = candidate / tuning->growth_threshold;
551 candidate = new_candidate;
553 candidate = next_prime (candidate);
554 if (xalloc_oversized (candidate, sizeof (struct hash_entry *)))
556 return candidate;
561 may insert at least CANDIDATE different user entries before any growth of
565 the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
594 hash_initialize (size_t candidate, const Hash_tuning *tuning,
622 table->n_buckets = compute_bucket_size (candidate, tuning);
935 specifying CANDIDATE. The contents of the hash table are preserved. The
937 the table may receive at least CANDIDATE different user entries, including
939 occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
943 hash_rehash (Hash_table *table, size_t candidate)
947 size_t new_size = compute_bucket_size (candidate, table->tuning);
1073 float candidate =
1079 if (SIZE_MAX <= candidate)
1083 if (!hash_rehash (table, candidate))
1175 size_t candidate =
1181 if (!hash_rehash (table, candidate))