-
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
now works on 32 bit arm platforms, such as RPi #18
base: master
Are you sure you want to change the base?
Conversation
flat_hash_map 32-bit fixes adapted from this PR: skarupke/flat_hash_map#18
Thank you for your changes, I included them in my copy of the code. I had a small problem, though. Your check for 32 or 64 bit systems does not handle AArch64 correctly, which leads to segmentation faults on that platform. Since quite some people seem to copy the changes from this pull request, you might want to add this fix. |
flat_hash_map.hpp
Outdated
|
||
// Check GCC | ||
#if __GNUC__ | ||
#if __x86_64__ || __ppc64__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
#if __x86_64__ || __ppc64__ || __aarch64__
* perf: switch to ska::flat_hash_map instead of std::unordered_map Small ~10% improvement to connectomics.npy renumber, but ~45% improvement to a random array. * fix: support 32-bit skarupke/flat_hash_map#18 * fix: allocate default table Avoids problems with dynamic library situations: skarupke/flat_hash_map#26 * fix: use more compatible definition of void_t * docs: update comment date
@@ -4,6 +4,24 @@ | |||
|
|||
#pragma once | |||
|
|||
// Check windows | |||
#if _WIN32 || _WIN64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if _WIN32 || _WIN64 | |
#if SIZE_MAX == UINT64_MAX |
same goes for every other place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code:
int8_t next_size_over(size_t & size) const
{
size = std::max(size_t(2), detailv3::next_power_of_two(size));
return 64 - detailv3::log2(size);
}
void commit(int8_t shift)
{
this->shift = shift;
}
void reset()
{
shift = 63;
}
private:
int8_t shift = 63;
also shall be adapted for 32 bits, because shift by more than 32 bits is UB
No description provided.