* Added hash_count_elements() and hash_count_used_slots() (mainly for

diagnostic purposes).
* hash_init() adjusts the table size to a prime number, which should
  result in a better element distribution, particularly since usually a
  power of two is passed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-09-09 17:19:52 +00:00
parent 8687956af2
commit 40c3aedf8d
2 changed files with 45 additions and 0 deletions
+2
View File
@@ -38,6 +38,8 @@ struct hash_iterator *hash_open(struct hash_table *table, struct hash_iterator *
void hash_close(struct hash_table *table, struct hash_iterator *i, bool free_iterator);
void *hash_next(struct hash_table *table, struct hash_iterator *i);
void hash_rewind(struct hash_table *table, struct hash_iterator *i);
uint32 hash_count_elements(struct hash_table *table);
uint32 hash_count_used_slots(struct hash_table *table);
/* function pointers must look like this:
*