Commit Graph

5 Commits

Author SHA1 Message Date
Axel Dörfler 4a67038e56 * Added a new function hash_insert_grow() that grows the hash table when needed.
* Removed the public hash_grow() function again (at least for now, it's only
  private).
* Removed the newSize argument from hash_grow(); it will compute the new size
  automatically.
* The block cache is now using hash_insert_grow() instead of hash_insert()
  which should make hash lookups much faster with some 10 thousand blocks,
  also increased the initial table size from 32 to 1024...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 19:57:40 +00:00
Michael Lotz dfa4dfe033 Something else that has been laying around for some time. Implemented hash_grow() that can grow a hash table to a new table size. Automatic growing is commented out in hash_insert() since there needs to be a way to disallow growing in certain cases (i.e. where no allocations can be made). This is detailed in the ToDo at the top of the file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-06 21:58:06 +00:00
Ingo Weinhold 40c3aedf8d * 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
2007-09-09 17:19:52 +00:00
Axel Dörfler 826e857cf0 Implemented hash_remove_current() which removes the current iterator position
from the hash - not yet tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-11 21:18:49 +00:00
Axel Dörfler 52fe8bf7a8 Minor header cleanup: moved some headers to better matching directories,
removed unused headers. Adapted sources to still compile with the new
header locations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-19 01:58:05 +00:00