From 684d54cc9670fbb48fc91a6450eefe19b7ba0ce8 Mon Sep 17 00:00:00 2001 From: Kinsey Favre Date: Mon, 24 Feb 2020 10:11:49 -0600 Subject: [PATCH] Add doc comment for padding_needed_for fn in pseudocode --- src/type-layout.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/type-layout.md b/src/type-layout.md index a824f5513..37cf88122 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -197,6 +197,8 @@ Here is this algorithm described in 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 {