Closed Peach1 closed 6 years ago
Hello,
The only reason I limited the size to 232 - 1 was effectively for memory reason (so that the size of bucket_entry
stays at 8 bytes). The trivial change from uint32_t
to uint64_t
would be enough, bucket_entry
will just use 16 bytes now.
When I designed the hash table, I had in mind to add a class template parameter to configure it if needed but I never actually did it. If you need larger maps, I will see to make it configurable.
Hello,
Sorry for the delay, I added a way to configure this through an extra IndexType
class template parameter.
tsl::ordered_map<int, int, std::hash<int>, std::equal_to<int>,
std::allocator<std::pair<int, int>>, std::vector<std::pair<int, int>>,
std::uint64_t> map;
I'll need to test that later before merging it to the master as I don't have enough RAM on my current computer to hold a large enough map.
I merged the changes to the master. See #18 for details.
Is there any reason for restricting it to 32 bit indexes? Could 264 - 1 values be supported with just a trivial change?
in ordered_hash.h, the indexes are defined as 32 bit:
defining them as 64 bit would be:
Besides additional memory usage, are there any implications of allowing 64 bit indexes?