-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use uint64_t instead of size_t? #5
Comments
I noticed this too in the log2 and next_power_of_two which emits Warning C4293 '>>': shift count negative or too big, undefined behavior with the 32 bit shifts definately seems like it warrants a fix |
these maps don't work on 32bit systems indeed. Replacing size_t with uint64_t helped. |
Also see #18 for 32 bit support. |
My native C++ code in an Android app uses this repo's unordered_map to replace std::unordered_map. It performs well on armeabiv8, resulting in a 50% reduction in duplicate entries for a dependency that relies on the hash table. However, when I prepared for gray-box testing by coincidentally switching to armeabiv7 (which is also a required supported version for the project) and tried to compile, it failed at prime_list. Initially, I thought it was a minor issue and changed size_t to llu suffix corresponding to long long unsigned int for array elements, and the compilation passed. However, upon running, it crashed. Then I came across this thread in the issues section, and it was so timely. Next, I'll see if there are any low-cost fixes available. If the author is still maintaining it, could you please fix these issues as soon as possible and also support 32-bit compilation? Thank you! Below is the original text in Chinese Simplified: |
I've just tried this branch (https://github.com/zertyz/flat_hash_map/tree/master), and it still didn't work for my project, pass compilation for armeabiv7 32bit, yet crashes still take place on using this modified flat hash map. For those trapped in the similar situation, I've tried hopscotch(https://github.com/Tessil/hopscotch-map), yet it shows little difference on my project. So following this, I rolled back to tsl::robin_map and it worked, unlike my last attempt (it showed little difference probabally due to my error-prone AB comparison approaches), the duplication removal job showed 30% drop in time consumption. So, you can use robin_map(https://github.com/Tessil/robin-map) as an ready to ship alternative, which is 32bit friendly as well as available for 64bit platforms. |
Code is using size_t in various places assuming it is at least 64 bit in size. This is not always true. Any chance we could get this more 32bit-friendly?
The text was updated successfully, but these errors were encountered: