[loc] hash functions improvements

* Fix a leak when freeing the hash table (actual size is htab_size+1)
* Use a better hash algorithm
* Use a larger table with a size already set to a prime
This commit is contained in:
Mehmetali KURAN 2013-11-02 18:45:06 +00:00
parent 434bae8954
commit c6da7311b0
3 changed files with 14 additions and 13 deletions

View file

@ -22,10 +22,11 @@
#pragma once
// Number of concurrent localization messages. Must be a power of 2.
// Number of concurrent localization messages (i.e. messages we can concurrently
// reference at the same time). Must be a power of 2.
#define LOC_MESSAGE_NB 8
#define LOC_MESSAGE_SIZE 2048
#define LOC_HTAB_SIZE 512
#define LOC_HTAB_SIZE 1031 // Using a prime speeds up the hash table init
// The [v]ersion major from a translation must match this number or
// the translation will be ignored