This commit is contained in:
Shunsuke Shibayama 2022-09-11 10:09:42 +09:00
parent 970b88f00e
commit 1c29e21aa4
3 changed files with 54 additions and 3 deletions

View file

@ -3,6 +3,7 @@ extern crate erg_compiler;
extern crate erg_parser;
use std::process;
use std::thread;
use erg_common::config::ErgConfig;
use erg_common::traits::Runnable;
@ -14,7 +15,7 @@ use erg_parser::ParserRunner;
use erg_type::deserialize::Deserializer;
fn main() {
fn run() {
let cfg = ErgConfig::parse();
match cfg.mode {
"lex" => {
@ -35,3 +36,19 @@ fn main() {
}
}
}
fn main() {
if cfg!(windows) {
const STACK_SIZE: usize = 4 * 1024 * 1024;
let child = thread::Builder::new()
.stack_size(STACK_SIZE)
.spawn(run)
.unwrap();
// Wait for thread to join
child.join().unwrap();
} else {
run();
}
}