+2003-03-17 Jan Hubicka <jh@suse.cz>
+
+ * hashtab.h (htab_traverse_noresize): Declare.
+
2003-02-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libiberty.h: Document return value of physmem routines.
extern void htab_remove_elt PARAMS ((htab_t, void *));
extern void htab_traverse PARAMS ((htab_t, htab_trav, void *));
+extern void htab_traverse_noresize PARAMS ((htab_t, htab_trav, void *));
extern size_t htab_size PARAMS ((htab_t));
extern size_t htab_elements PARAMS ((htab_t));
+2003-17-03 Jan Hubicka <jh@suse.cz>
+
+ * hashtab.c (htab_traverse_noresize): Break out from ...
+ * hashtab.c (htab_traverse): ... here.
+
2003-12-03 Jan Hubicka <jh@suse.cz>
* hashtab.c (htab_expand): Fix warning.
argument. */
void
-htab_traverse (htab, callback, info)
+htab_traverse_noresize (htab, callback, info)
htab_t htab;
htab_trav callback;
PTR info;
PTR *slot;
PTR *limit;
- if ((htab->n_elements - htab->n_deleted) * 8 < htab->size)
- htab_expand (htab);
-
slot = htab->entries;
limit = slot + htab->size;
while (++slot < limit);
}
+/* Like htab_traverse_noresize, but does resize the table when it is
+ too empty to improve effectivity of subsequent calls. */
+
+void
+htab_traverse (htab, callback, info)
+ htab_t htab;
+ htab_trav callback;
+ PTR info;
+{
+ PTR *slot;
+ PTR *limit;
+
+ if ((htab->n_elements - htab->n_deleted) * 8 < htab->size)
+ htab_expand (htab);
+
+ htab_traverse_noresize (htab, callback, info);
+}
+
/* Return the current size of given hash table. */
size_t