GenTiradentes/tinyvm — pull request #21 by bl0ckeduser (2012-01-18 18:06:38+00:00)
Title: Fix hash collisions

Hi,

I read about hashtables in K&R. It seems avoiding collisions is fairly easy.

I have used the technique of "Separate chaining" here (http://en.wikipedia.org/wiki/Hash_table#Separate_chaining).

(that might be exactly the same as the technique shown in K&R, I'm not sure).

I hope you find the code isn't too messy :)

I've tested it by running a program that actually hash-collided on my machine,
and also by changing the hash function to always return the same hash.