aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-06-21 11:37:31 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-06-21 11:37:31 +0200
commita46f975bee74ff08eb97aac61f2fb81faa2c173f (patch)
tree78044b4964bd0f9ad698377fc65677426b49252f /libiberty
parent3d25028c8fc3d8708cb1e1542689ab89a6c2aeed (diff)
downloadgcc-a46f975bee74ff08eb97aac61f2fb81faa2c173f.zip
gcc-a46f975bee74ff08eb97aac61f2fb81faa2c173f.tar.gz
gcc-a46f975bee74ff08eb97aac61f2fb81faa2c173f.tar.bz2
hashtab.c (htab_traverse): Don't call htab_expand for nearly empty hashtabs with sizes 7, 13 or 31.
* hashtab.c (htab_traverse): Don't call htab_expand for nearly empty hashtabs with sizes 7, 13 or 31. From-SVN: r148759
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/hashtab.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f5ac783..eb7c913 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 bf34a6d..3e64921 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);