Skip to content

Commit 684d54c

Browse files
committed
Add doc comment for padding_needed_for fn in pseudocode
1 parent 5dc7f5c commit 684d54c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/type-layout.md

+2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ Here is this algorithm described in pseudocode.
197197

198198
<!-- ignore: pseudocode -->
199199
```rust,ignore
200+
/// Returns the amount of padding needed after `offset` to ensure that the
201+
/// following address will be aligned to `alignment`.
200202
fn padding_needed_for(offset: usize, alignment: usize) -> usize {
201203
let misalignment = offset % alignment;
202204
if misalignment > 0 {

0 commit comments

Comments
 (0)