Skip to content
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

Integer keys need byte-ordering swap? #49

Open
pohchaichon opened this issue Nov 27, 2021 · 0 comments
Open

Integer keys need byte-ordering swap? #49

pohchaichon opened this issue Nov 27, 2021 · 0 comments

Comments

@pohchaichon
Copy link

Hi!

I am trying to use this implementation of ART for 64-bit unsigned integer keys.
Since the interface accept unsigned char array, I would like to confirm that integer keys needs to have their byte-ordering swap in little-endian machine?

i.e. instead of

uint64_t key = 123456789
void* val_ptr = art_search(&t, (unsigned char*) &key, sizeof(uint64_t));

I should do

uint64_t key = 123456789
uint64_t reversed_key = __builtin_bswap64(key);
void* val_ptr = art_search(&t, (unsigned char*) &reversed_key, sizeof(uint64_t));

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant