Intentionally leak arena for batch builds

This commit is contained in:
Richard Feldman 2021-04-28 21:47:51 -04:00
parent e23d526a4c
commit 65296b9446

View file

@ -175,12 +175,6 @@ pub fn build(target: &Triple, matches: &ArgMatches, config: BuildConfig) -> io::
.strip_prefix(env::current_dir().unwrap())
.unwrap_or(&binary_path);
println!(
"🎉 Built {} in {} ms",
generated_filename.to_str().unwrap(),
total_time.as_millis()
);
// Return a nonzero exit code if there were problems
let status_code = match outcome {
BuildOutcome::NoProblems => 0,
@ -188,6 +182,16 @@ pub fn build(target: &Triple, matches: &ArgMatches, config: BuildConfig) -> io::
BuildOutcome::Errors => 2,
};
// No need to waste time freeing this memory,
// since the process is about to exit anyway.
std::mem::forget(arena);
println!(
"🎉 Built {} in {} ms",
generated_filename.to_str().unwrap(),
total_time.as_millis()
);
Ok(status_code)
}
BuildAndRun { roc_file_arg_index } => {