Skip to content

Integer keys need byte-ordering swap? #49

@pohchaichon

Description

@pohchaichon

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions