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

Fix MLD level mask generation to support 64-bit masks. #6123

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

mjjbell
Copy link
Member

@mjjbell mjjbell commented Sep 12, 2021

Issue

As discovered in #6121

The generation of level masks for compactly storing partition cells supports sizes that can be stored in 64 bits.

The current implementation fails if the total bit sum is 64 bits exactly. A bit shift mechanism is used that is undefined when the
shift size is equal to the bit size of the underlying type. This generates an incorrect mask value.

We fix this by adding a special case for a 64 bit offset. Given this code is called at most |level| times, there will be no effect on
performance. We also update the assertions to reflect 64 bit masks are now supported.

Tasklist

The generation of level masks for compactly storing partition cells
supports sizes that can be stored in 64 bits.

The current implementation fails if the total bit sum is 64 bits
exactly. A bit shift mechanism is used that is undefined when the
shift size is equal to the bit size of the underlying type. This
generates an incorrect mask value.

We fix this by adding a special case for a 64 bit offset. Given this
code is called at most |level| times, there will be no effect on
performance. We also update the assertions to reflect 64 bit masks
are now supported.
@mjjbell mjjbell merged commit f1f9616 into Project-OSRM:master Sep 21, 2021
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.

2 participants