From fcaab573cce8e347a9e891a143c34060553b81d4 Mon Sep 17 00:00:00 2001 From: Mark Shroyer Date: Sun, 22 Oct 2023 20:02:28 -0700 Subject: [PATCH] Don't enable GC fork() support on Windows A previous commit unconditionally configures Boehm GC to support fork. This breaks the Windows MSVC build, producing an error dialog with the message "Fatal error in GC: fork() handling unsupported". This commit restricts the call to GC_set_handle_fork to non-Windows hosts. --- src/c/alloc_2.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 04c69ba52..1031914a5 100644 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -760,12 +760,15 @@ init_alloc(void) * the begining or to the first byte. * 3) Out of the incremental garbage collector, we only use the * generational component. - * 4) GC should handle fork() which is used to run subprocess. + * 4) GC should handle fork() which is used to run subprocess on + * some platforms. */ GC_set_no_dls(1); GC_set_all_interior_pointers(0); GC_set_time_limit(GC_TIME_UNLIMITED); +#ifndef ECL_MS_WINDOWS_HOST GC_set_handle_fork(1); +#endif GC_init(); #ifdef ECL_THREADS # if GC_VERSION_MAJOR > 7 || GC_VERSION_MINOR > 1 -- GitLab