Skip to content

Commit

Permalink
Add doc comment for padding_needed_for fn in pseudocode
Browse files Browse the repository at this point in the history
  • Loading branch information
kinseytamsin committed Feb 24, 2020
1 parent 13e415a commit 5d5b233
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/type-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ Here is this algorithm described in pseudocode.

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

0 comments on commit 5d5b233

Please sign in to comment.