Skip to content

Commit

Permalink
Allow inlining of ensure_sufficient_stack()
Browse files Browse the repository at this point in the history
  • Loading branch information
hkratz committed Feb 12, 2022
1 parent 9cdefd7 commit 59536fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_data_structures/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const STACK_PER_RECURSION: usize = 1 * 1024 * 1024; // 1MB
/// from this.
///
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
#[inline]
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
stacker::maybe_grow(RED_ZONE, STACK_PER_RECURSION, f)
}

0 comments on commit 59536fb

Please sign in to comment.