Skip to content

Commit

Permalink
fmt, change to cold
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Mar 21, 2021
1 parent f5e3710 commit 73d7734
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/alloc/src/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,12 @@ impl<T, A: Allocator> RawVec<T, A> {
// Therefore, we move all the resizing and error-handling logic from grow_amortized and
// handle_reserve behind a call, while making sure that the this function is likely to be
// inlined as just a comparison and a call if the comparison fails.
#[inline(never)]
fn do_reserve_and_handle<T, A: Allocator>(slf: &mut RawVec<T,A>, len: usize, additional: usize) {
#[cold]
fn do_reserve_and_handle<T, A: Allocator>(
slf: &mut RawVec<T, A>,
len: usize,
additional: usize,
) {
handle_reserve(slf.grow_amortized(len, additional));
}

Expand Down

0 comments on commit 73d7734

Please sign in to comment.