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

Calculate the next power-of-two for the user in hash_map_init. #420

Merged
merged 4 commits into from
Apr 11, 2023

Conversation

clalancette
Copy link
Contributor

That is, we allow the user to specify non powers of two, and then we do the calculation for them.

@wjwwood FYI.

That is, we allow the user to specify non powers of two,
and then we do the calculation for them.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Contributor Author

Also @methylDragon FYI; assuming we take this, you'll be able to drop some of your code from ros2/rosidl#728

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@methylDragon
Copy link
Contributor

I just tried the next_power_of_two again, and now I'm getting runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int'...

I'm not sure why bit twiddling isn't working here :/

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

Co-authored-by: methylDragon <methylDragon@gmail.com>
Copy link
Contributor

@methylDragon methylDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more change... Sorry

Copy link
Contributor

@methylDragon methylDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a pre-emptive approval (we should get that suggestion merged though!!)

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks for this! ❤️

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

Co-authored-by: methylDragon <methylDragon@gmail.com>
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit dbd3ff4 into rolling Apr 11, 2023
@delete-merged-branch delete-merged-branch bot deleted the clalancette/calculate-power-of-two branch April 11, 2023 00:43
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

Successfully merging this pull request may close these issues.

4 participants