authorgravatar for shawn@git.icuShawn Landden <shawn@git.icu> 2018-08-31 19:29:06-07:00
committergravatar for shawn@git.icuShawn Landden <shawn@git.icu> 2018-09-08 03:52:28+00:00
logfdeb8765f0dd0d147371b22a28b442c6f19fa36d
tree418e8e98d32964c838405952a2327120e326e683
parentcba0d76fbcbaf4e45a277a36fc7f0be0b60c7e14

use vfork in stage1 compiler to avoid OOM


1 files changed, 3 insertions(+), 3 deletions(-)

src/os.cpp+3-3
......@@ -125,7 +125,7 @@ static void populate_termination(Termination *term, int status) {
125125static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, Termination *term) {
126126 pid_t pid = fork();
127127 if (pid == -1)
128 zig_panic("fork failed");
128 zig_panic("fork failed: %s", strerror(errno));
129129 if (pid == 0) {
130130 // child
131131 const char **argv = allocate<const char *>(args.length + 2);
......@@ -839,9 +839,9 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,
839839 if ((err = pipe(stderr_pipe)))
840840 zig_panic("pipe failed");
841841
842 pid_t pid = fork();
842 pid_t pid = vfork();
843843 if (pid == -1)
844 zig_panic("fork failed");
844 zig_panic("fork failed: %s", strerror(errno));
845845 if (pid == 0) {
846846 // child
847847 if (dup2(stdin_pipe[0], STDIN_FILENO) == -1)