-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HashTable: fix issues on 32bit platforms
- RESERVED is uint32_t, so we can't assign it to a 32bit int - in general, instead of using C int, let's rather use size_t for array indexes and sizes. size_t is unsigned, so no problem with that. it's 32bit on 32bit platforms, 64bit on 64bit platforms. - exception: indexes into the kv array are always only uint32_t to save memory. Note that due to the load factor of the hashtable, it makes sense to have hashtables with a bit more than 2*32 buckets even if the kv array is limited to less than 2**32. If there would be close to 2**32 stored kv items, the hashtable would be approximately 2**33 buckets large (if the load factor is 0.5).
- Loading branch information
1 parent
37c708a
commit 8e73059
Showing
2 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters