From abedb3aa560dcd3281bd307f65f5dce93b2be319 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 6 Sep 2021 21:42:04 +0300 Subject: Avoid dirty_init warn of incremental mode incompatible with fork on Darwin (fix of commit 3c571c7ad) Issue #151 (bdwgc). To both support GC incremental mode and GC functions usage in the forked child, pthread_atfork should be used to install handlers that switch off GC_incremental in the child gracefully. For now, we just disable incremental mode if fork() handling is requested by client. Previously, GC incremental mode was disabled if parallel marker is on. * CMakeLists.txt [APPLE && enable_handle_fork && !disable_handle_fork && enable_parallel_mark] (HANDLE_FORK): Do not define; update comment. * configure.ac [$enable_handle_fork!=yes && $enable_handle_fork!=no && $enable_handle_fork!=manual && $THREADS==posix && $host==*-*-darwin* && $use_parallel_mark!=no] (HANDLE_FORK): Likewise. --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 282c8b1e..4fdaed04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,12 +194,8 @@ if (CMAKE_USE_PTHREADS_INIT) if (ANDROID OR MSYS) # ANDROID variable is defined by CMake v3.7.0+. # Android NDK does not provide pthread_atfork. elseif (APPLE) - if (enable_handle_fork AND NOT disable_handle_fork) - # The incremental mode conflicts with fork handling. - if (enable_parallel_mark) - add_definitions("-DHANDLE_FORK") - endif(enable_parallel_mark) - endif() + # The incremental mode conflicts with fork handling (for now). + # Thus, HANDLE_FORK is not defined. set(SRC ${SRC} darwin_stop_world.c) elseif (enable_handle_fork AND NOT disable_handle_fork) add_definitions("-DHANDLE_FORK") -- cgit v1.2.1