Skip to content

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

Merged
mjjbell merged 1 commit intoProject-OSRM:masterfrom
mjjbell:mbell/mld_64bit_mask
Sep 21, 2021
Merged

Fix MLD level mask generation to support 64-bit masks.#6123
mjjbell merged 1 commit intoProject-OSRM:masterfrom
mjjbell:mbell/mld_64bit_mask

Conversation

@mjjbell
Copy link
Copy Markdown
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