Skip to content

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

Merged
clalancette merged 4 commits intorollingfrom
clalancette/calculate-power-of-two
Apr 11, 2023
Merged

Calculate the next power-of-two for the user in hash_map_init.#420
clalancette merged 4 commits intorollingfrom
clalancette/calculate-power-of-two

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