diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-09-25 03:27:25 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-09-25 22:54:07 +0200 |
| commit | 2c507cae363a71f16069bbf602aa50e00f3ceec4 (patch) | |
| tree | eaca48d6359d6ed0547520221155d1b80c7e1a4e /compiler/rustc_arena | |
| parent | 91958e0a7417727a8b65c7f2c163677a8d4ec75d (diff) | |
| download | rust-2c507cae363a71f16069bbf602aa50e00f3ceec4.tar.gz rust-2c507cae363a71f16069bbf602aa50e00f3ceec4.zip | |
Rename `cold_path` to `outline`
Diffstat (limited to 'compiler/rustc_arena')
| -rw-r--r-- | compiler/rustc_arena/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index f14463fe940..23fdd272ffd 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -37,9 +37,10 @@ use std::ptr::{self, NonNull}; use std::slice; use std::{cmp, intrinsics}; +/// This calls the passed function while ensuring it won't be inlined into the caller. #[inline(never)] #[cold] -fn cold_path<F: FnOnce() -> R, R>(f: F) -> R { +fn outline<F: FnOnce() -> R, R>(f: F) -> R { f() } @@ -600,7 +601,7 @@ impl DroplessArena { unsafe { self.write_from_iter(iter, len, mem) } } (_, _) => { - cold_path(move || -> &mut [T] { + outline(move || -> &mut [T] { let mut vec: SmallVec<[_; 8]> = iter.collect(); if vec.is_empty() { return &mut []; |
