From 5d5b233a13100bbde50f7b66652956c86bbb82df 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 c572f1efe..967c9ed1e 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 {