Add some more #[inline] annotations for trivial functions (#2817)

Looking at some profiles these or their related functions were all
showing up, so this commit adds `#[inline]` to allow cross-crate
inlining by default.
This commit is contained in:
Alex Crichton
2021-04-08 12:23:54 -05:00
committed by GitHub
parent 5c4c03d278
commit c77ea0c5c7
5 changed files with 23 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ fn cast_to_u32(sz: usize) -> u32 {
}
/// Align an offset used in this module to a specific byte-width by rounding up
#[inline]
fn align(offset: u32, width: u32) -> u32 {
(offset + (width - 1)) / width * width
}