Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 24, 2023
1 parent 82945c0 commit 40bf4aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,13 @@ impl<T> RcSliceBuilder<T> {
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::<u8>() as usize / 4) * 64;
self.displacement = (64 - 16) + (rand::random::<u8>() as usize / 4) * 64;
}
let (layout, offset) = Self::layout_for_size(needed_len + self.displacement);
unsafe {
Expand Down

0 comments on commit 40bf4aa

Please sign in to comment.