Fix bit-shift overflow in MLD partition step for Windows builds
For very large graphs, generation of MLD level masks fail on Windows due to bit shift overflow of unsigned long values. Correct by using unsigned long long literals, which are 64 bit on all major systems.
This commit is contained in:
@@ -212,10 +212,10 @@ template <storage::Ownership Ownership> class MultiLevelPartitionImpl final
|
||||
// create mask that has `bits` ones at its LSBs.
|
||||
// 000011
|
||||
BOOST_ASSERT(offset < NUM_PARTITION_BITS);
|
||||
PartitionID mask = (1UL << offset) - 1UL;
|
||||
PartitionID mask = (1ULL << offset) - 1ULL;
|
||||
// 001111
|
||||
BOOST_ASSERT(next_offset < NUM_PARTITION_BITS);
|
||||
PartitionID next_mask = (1UL << next_offset) - 1UL;
|
||||
PartitionID next_mask = (1ULL << next_offset) - 1ULL;
|
||||
// 001100
|
||||
masks[lidx++] = next_mask ^ mask;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user