emiltayl/hashtable

Prevent the hash table from growing too large

Opened this issue · 0 comments

Currently it is possible to fill up the hash table so much that the size variable overflows, which might cause all sorts of problems. There should be a check to see whether the hash table is at it's maximum size, and in that case we shouldn't grow the table more. As size_t's maximum size is the largest size an array can be, there is no point trying to grow the size beyond that.

It might be best to let the users supply their own max sizes, where size_t's maximum value is the upper bound for what value can be set.