Add htable_grow()
commitdfaf4590e5892e9622b4a4718a64afda18e06380
authorStathis Kamperis <ekamperi@auth.gr>
Sat, 8 Sep 2007 16:50:21 +0000 (8 19:50 +0300)
committerStathis Kamperis <ekamperi@auth.gr>
Sat, 8 Sep 2007 16:50:21 +0000 (8 19:50 +0300)
tree79386d8abe5ec8a6914d1537a17f29a28423162f
parentd24dc78c93ac77c04802dbefadd9dc15f3f5a5d9
Add htable_grow()
When initalizing a hash table set a factor that will determine
the limit, beyond of which, the table will grow.

For example, a table with size = 100 and factor = 2,
will grow if it's used items become more than 200.

The strategy we follow for growing is the following:
1) We allocate a new hash table twice as big as the old one
2) We copy all items from the old one to the new one,
rehashing as appropriate
3) We free the old table
genstructs/htable/htable.c
genstructs/htable/htable.h
genstructs/htable/main.c