diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-09-06 21:42:04 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-09-06 21:42:04 +0300 |
commit | abedb3aa560dcd3281bd307f65f5dce93b2be319 (patch) | |
tree | 0cb6a0e7d18de4c6611dd84a9b0ebd03672f6d6e | |
parent | 149d1b3734dd9a0c05250bd2543f13469687666d (diff) | |
download | bdwgc-abedb3aa560dcd3281bd307f65f5dce93b2be319.tar.gz |
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.
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | configure.ac | 6 |
2 files changed, 3 insertions, 11 deletions
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") diff --git a/configure.ac b/configure.ac index eb0b582c..f5842f5c 100644 --- a/configure.ac +++ b/configure.ac @@ -1177,11 +1177,7 @@ elif test "${enable_handle_fork}" != manual -a x$THREADS = xposix; then # Android NDK does not provide pthread_atfork. ;; *-*-darwin*) - # The incremental mode (which is off if parallel marking) conflicts - # with fork handling on Darwin. - if test x$use_parallel_mark != xno; then - AC_DEFINE(HANDLE_FORK) - fi + # The incremental mode conflicts with fork handling on Darwin. ;; *-*-aix* | *-*-cygwin* | *-*-freebsd* | *-*-haiku* | \ *-*-hpux11* | *-*-irix* | *-*-kfreebsd*-gnu | \ |