Skip to content

Commit ed22f23

Browse files
authored
Merge pull request #151 from CodaFi/align
Add modulus for size and alignment
2 parents aefce6e + 9e10851 commit ed22f23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/LLVM/Units.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public struct Size {
139139
let value = self.rawValue + mask
140140
return Size(value & ~mask)
141141
}
142+
143+
public static func % (lhs: Size, rhs: Alignment) -> Size {
144+
return Size(lhs.rawValue % UInt64(rhs.rawValue))
145+
}
142146
}
143147

144148
extension Size: UnsignedInteger {

0 commit comments

Comments
 (0)