Hi all. I want to implement a Transposition table for my Gomoku engine which i started to write in C. I am relatively new to the language (coming from java) so I need some advices.
The most logical approach (I think) is to use a struct called "Entry" that will contain all the relevant information for a position.. like depth,hash key, score etc.
Those structs will be stored in a table (Array) of more than a million entries.. (maybe a lot more, but this will suffice for now).
Is it best to make the table contain the pointers to the structs or the actual structs? the reason for this question is ,I don't know if it is better to make all the entries NULL pointers at initialization (?) That means that when i want to store an entry in the table i will have to allocate memory dynamically every time i do that? can it be a little slow?
I can instead use some sort of a flag indicating whether an entry is active or not, and change that. in the latter case i guess i don't need to use pointers but i can initiate the whole 1,000000+ entires right from the start?
I am clueless..what is better approach and please feel free to recommend other ideas.
Thx!
EDIT: oh..and i will be using the Zobrist hashing scheme for the hash keys.. 64 bit hash keys