diff options
author | Nick Clifton <nickc@redhat.com> | 2011-06-03 16:16:32 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-06-03 16:16:32 +0000 |
commit | 164a5cb7bde2ca6fc6a9876eb8cc8ecafe5a00ac (patch) | |
tree | 71aa366bb63857f9d16a5dfb55b7c76368131526 | |
parent | 8cf64490f293549a0b8e64342d7c97099df19974 (diff) | |
download | gdb-164a5cb7bde2ca6fc6a9876eb8cc8ecafe5a00ac.zip gdb-164a5cb7bde2ca6fc6a9876eb8cc8ecafe5a00ac.tar.gz gdb-164a5cb7bde2ca6fc6a9876eb8cc8ecafe5a00ac.tar.bz2 |
PR ld/12682
* hash.c (higher_primer_number): Add more, small, prime numbers.
(bfd_hash_set_default_size): Likewise.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/hash.c | 53 |
2 files changed, 37 insertions, 22 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fd48cc3..034e9e7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2011-06-03 Bertram Felgenhauer <bertram.felgenhauer@gmail.com> + + PR ld/12682 + * hash.c (higher_primer_number): Add more, small, prime numbers. + (bfd_hash_set_default_size): Likewise. + 2011-06-02 Nick Clifton <nickc@redhat.com> * coff-mcore.c: Fix spelling typo. @@ -310,28 +310,37 @@ higher_prime_number (unsigned long n) { /* These are primes that are near, but slightly smaller than, a power of two. */ - static const unsigned long primes[] = { - (unsigned long) 127, - (unsigned long) 2039, - (unsigned long) 32749, - (unsigned long) 65521, - (unsigned long) 131071, - (unsigned long) 262139, - (unsigned long) 524287, - (unsigned long) 1048573, - (unsigned long) 2097143, - (unsigned long) 4194301, - (unsigned long) 8388593, - (unsigned long) 16777213, - (unsigned long) 33554393, - (unsigned long) 67108859, - (unsigned long) 134217689, - (unsigned long) 268435399, - (unsigned long) 536870909, - (unsigned long) 1073741789, - (unsigned long) 2147483647, + static const unsigned long primes[] = + { + (unsigned long) 31, + (unsigned long) 61, + (unsigned long) 127, + (unsigned long) 251, + (unsigned long) 509, + (unsigned long) 1021, + (unsigned long) 2039, + (unsigned long) 4093, + (unsigned long) 8191, + (unsigned long) 16381, + (unsigned long) 32749, + (unsigned long) 65521, + (unsigned long) 131071, + (unsigned long) 262139, + (unsigned long) 524287, + (unsigned long) 1048573, + (unsigned long) 2097143, + (unsigned long) 4194301, + (unsigned long) 8388593, + (unsigned long) 16777213, + (unsigned long) 33554393, + (unsigned long) 67108859, + (unsigned long) 134217689, + (unsigned long) 268435399, + (unsigned long) 536870909, + (unsigned long) 1073741789, + (unsigned long) 2147483647, /* 4294967291L */ - ((unsigned long) 2147483647) + ((unsigned long) 2147483644), + ((unsigned long) 2147483647) + ((unsigned long) 2147483644), }; const unsigned long *low = &primes[0]; @@ -657,7 +666,7 @@ bfd_hash_set_default_size (unsigned long hash_size) /* Extend this prime list if you want more granularity of hash table size. */ static const unsigned long hash_size_primes[] = { - 251, 509, 1021, 2039, 4051, 8599, 16699, 32749, 65537 + 31, 61, 127, 251, 509, 1021, 2039, 4091, 8191, 16381, 32749, 65537 }; unsigned int _index; |