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) {...@@ -125,7 +125,7 @@ static void populate_termination(Termination *term, int status) {
125static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, Termination *term) {125static void os_spawn_process_posix(const char *exe, ZigList<const char *> &args, Termination *term) {
126 pid_t pid = fork();126 pid_t pid = fork();
127 if (pid == -1)127 if (pid == -1)
128 zig_panic("fork failed");128 zig_panic("fork failed: %s", strerror(errno));
129 if (pid == 0) {129 if (pid == 0) {
130 // child130 // child
131 const char **argv = allocate<const char *>(args.length + 2);131 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,...@@ -839,9 +839,9 @@ static int os_exec_process_posix(const char *exe, ZigList<const char *> &args,
839 if ((err = pipe(stderr_pipe)))839 if ((err = pipe(stderr_pipe)))
840 zig_panic("pipe failed");840 zig_panic("pipe failed");
841841
842 pid_t pid = fork();842 pid_t pid = vfork();
843 if (pid == -1)843 if (pid == -1)
844 zig_panic("fork failed");844 zig_panic("fork failed: %s", strerror(errno));
845 if (pid == 0) {845 if (pid == 0) {
846 // child846 // child
847 if (dup2(stdin_pipe[0], STDIN_FILENO) == -1)847 if (dup2(stdin_pipe[0], STDIN_FILENO) == -1)