diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-03 17:38:04 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-03 17:38:04 +0100 |
| commit | db64f60b1d7469806b90010e2d17f500630a53fa (patch) | |
| tree | db4fba05ba2ff9757b698c6741fa2d19b8090ba5 | |
| parent | 9cd3bef4cfaaac2a608682d4b0834cda344249e0 (diff) | |
| download | rust-db64f60b1d7469806b90010e2d17f500630a53fa.tar.gz rust-db64f60b1d7469806b90010e2d17f500630a53fa.zip | |
Bump stack size to 32MB
| -rw-r--r-- | src/librustc_driver/driver.rs | 2 | ||||
| -rw-r--r-- | src/librustc_driver/lib.rs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index c1705ad2d58..777cc09b8b1 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -91,7 +91,7 @@ pub fn spawn_thread_pool<F: FnOnce(config::Options) -> R + sync::Send, R: sync:: let config = ThreadPoolBuilder::new() .num_threads(Session::query_threads_from_opts(&opts)) .deadlock_handler(|| unsafe { ty::query::handle_deadlock() }) - .stack_size(16 * 1024 * 1024); + .stack_size(::STACK_SIZE); let with_pool = move |pool: &ThreadPool| { pool.install(move || f(opts)) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 42576dcae64..061c19eca36 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -1468,6 +1468,11 @@ fn parse_crate_attrs<'a>(sess: &'a Session, input: &Input) -> PResult<'a, Vec<as } } +// Temporarily have stack size set to 32MB to deal with various crates with long method +// chains or deep syntax trees. +// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line +const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB + /// Runs `f` in a suitable thread for running `rustc`; returns a `Result` with either the return /// value of `f` or -- if a panic occurs -- the panic value. /// @@ -1477,9 +1482,6 @@ pub fn in_named_rustc_thread<F, R>(name: String, f: F) -> Result<R, Box<dyn Any where F: FnOnce() -> R + Send + 'static, R: Send + 'static, { - // Temporarily have stack size set to 16MB to deal with nom-using crates failing - const STACK_SIZE: usize = 16 * 1024 * 1024; // 16MB - #[cfg(all(unix, not(target_os = "haiku")))] let spawn_thread = unsafe { // Fetch the current resource limits |
