From 40bf4aaccbb2803d12efcecb52a32f40de646306 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 24 Nov 2023 18:03:56 +0900 Subject: [PATCH] try --- src/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.rs b/src/util.rs index fde2ef5b1..2430187f1 100644 --- a/src/util.rs +++ b/src/util.rs @@ -552,13 +552,13 @@ impl RcSliceBuilder { halfway } }; - (Layout::from_size_align(size, align).unwrap(), offset) + (Layout::from_size_align(size, align).unwrap().align_to(64).unwrap(), offset) } #[inline(never)] fn grow_to(&mut self, needed_len: usize) { if self.capacity == 0 { - self.displacement = (rand::random::() as usize / 4) * 64; + self.displacement = (64 - 16) + (rand::random::() as usize / 4) * 64; } let (layout, offset) = Self::layout_for_size(needed_len + self.displacement); unsafe {