diff options
author | DJ Delorie <dj@delorie.com> | 2009-06-21 17:13:08 +0000 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2009-06-21 17:13:08 +0000 |
commit | 5731da445d5947416a694227bc4b807e59612014 (patch) | |
tree | 5cb52f73756ae78271887e5ecd25465038d82640 | |
parent | 5e9f6a7e091ee0dcbaac7027e50f0d8d9cfbd197 (diff) | |
download | gdb-5731da445d5947416a694227bc4b807e59612014.tar.gz |
merge from gcc
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/hashtab.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index f5ac7832942..eb7c913b838 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2009-06-21 Jakub Jelinek <jakub@redhat.com> + + * hashtab.c (htab_traverse): Don't call htab_expand for + nearly empty hashtabs with sizes 7, 13 or 31. + 2009-06-16 Nick Clifton <nickc@redhat.com> PR 10197 diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index bf34a6d297e..3e649215f42 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -1,5 +1,5 @@ /* An expandable hash tables datatype. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). @@ -759,7 +759,8 @@ htab_traverse_noresize (htab_t htab, htab_trav callback, PTR info) void htab_traverse (htab_t htab, htab_trav callback, PTR info) { - if (htab_elements (htab) * 8 < htab_size (htab)) + size_t size = htab_size (htab); + if (htab_elements (htab) * 8 < size && size > 32) htab_expand (htab); htab_traverse_noresize (htab, callback, info); |