From 54b6b23fc0e464110d8f4c6a6ab12aaeb7e2a198 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 27 Jul 2017 14:53:44 -0700 Subject: std: Mark `Layout::repeat` as `#[inline]` This fixes an optimization regression by allowing LLVM to see through more functions. Closes #43272 --- src/liballoc/allocator.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liballoc') diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs index efc59d2cbc8..2a1a8e73e9e 100644 --- a/src/liballoc/allocator.rs +++ b/src/liballoc/allocator.rs @@ -207,6 +207,7 @@ impl Layout { /// of each element in the array. /// /// On arithmetic overflow, returns `None`. + #[inline] pub fn repeat(&self, n: usize) -> Option<(Self, usize)> { let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) { None => return None, -- cgit 1.4.1-3-g733a5