We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4d26ae commit a146431Copy full SHA for a146431
cogent/src/Cogent/Dargent/Allocation.hs
@@ -250,8 +250,7 @@ data AlignedBitRange
250
{- * Word alignment transformations -}
251
252
alignSize :: Size -> Size -> Size
253
-alignSize toMultipleOf size =
254
- size + ((toMultipleOf - size `mod` toMultipleOf) `mod` toMultipleOf)
+alignSize toMultipleOf size = ceiling (fromIntegral size / fromIntegral toMultipleOf) * toMultipleOf
255
256
-- | Aligns an 'Offsettable' (assumed to initially have offset 0)
257
-- so that its new offset is the smallest offset which is at least 'minBitOffset'
0 commit comments