Returns the padding required to align `offset` to `alignment`.
(offset: int, alignment: int)
| 27 | |
| 28 | |
| 29 | def padding_required(offset: int, alignment: int) -> int: |
| 30 | """Returns the padding required to align `offset` to `alignment`.""" |
| 31 | remainder: int = offset % alignment |
| 32 | if remainder != 0: |
| 33 | return alignment - remainder |
| 34 | return 0 |
| 35 | |
| 36 | |
| 37 | def aligned_size(input_size: int, alignment: int) -> int: |
no outgoing calls
no test coverage detected