From: Aaron Turon Date: Wed, 21 Jan 2015 00:37:00 +0000 (-0800) Subject: Change init-large-type to use child thread X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=da8023d653618431f8e1c651e0c3b83fa0d4269a;p=rust.git Change init-large-type to use child thread --- diff --git a/src/test/run-pass/init-large-type.rs b/src/test/run-pass/init-large-type.rs index 0534d0c054f..8ee6054f8ba 100644 --- a/src/test/run-pass/init-large-type.rs +++ b/src/test/run-pass/init-large-type.rs @@ -14,6 +14,8 @@ #![feature(intrinsics)] +use std::thread::Thread; + extern "rust-intrinsic" { pub fn init() -> T; } @@ -21,5 +23,8 @@ const SIZE: usize = 1024 * 1024; fn main() { - let _memory: [u8; SIZE] = unsafe { init() }; + // do the test in a new thread to avoid (spurious?) stack overflows + let _ = Thread::scoped(|| { + let _memory: [u8; SIZE] = unsafe { init() }; + }).join(); }