Clean up roc_dev_native a bit

`writer` is only used by the parent process, so we don't need the
soon-to-be-forked child process to create it just to immediately get
overwritten by `execve`.
This commit is contained in:
Jackson Wambolt 2024-06-26 04:54:51 +00:00
parent 11c9b90551
commit d0f8dbe85b
No known key found for this signature in database
GPG key ID: 76F29A42FEE8811C

View file

@ -1205,14 +1205,11 @@ fn roc_dev_native(
layout_interner,
} = expect_metadata;
// let shm_name =
let shm_name = format!("/roc_expect_buffer_{}", std::process::id());
let mut memory = ExpectMemory::create_or_reuse_mmap(&shm_name);
let layout_interner = layout_interner.into_global();
let mut writer = std::io::stdout();
match unsafe { libc::fork() } {
0 => unsafe {
// we are the child
@ -1253,6 +1250,7 @@ fn roc_dev_native(
};
}
ChildProcessMsg::Expect => {
let mut writer = std::io::stdout();
roc_repl_expect::run::render_expects_in_memory(
&mut writer,
arena,