mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-19 19:53:38 -04:00
Allow inlining of ensure_sufficient_stack()
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user