(define HANDLE_FORK on Unix platforms with pthreads)
* doc/README.macros (HANDLE_FORK): Replace with NO_HANDLE_FORK; update
the documentation.
* include/private/gcconfig.h (HANDLE_FORK): Explicitly define if
GC_PTHREADS unless already defined or NO_HANDLE_FORK is defined, or
unsupported on the target.
makes incremental collection easier. Was enabled by default until 6.0.
Rarely used, to my knowledge.
-HANDLE_FORK Attempts to make GC_malloc() work in a child process fork()'ed
- from a multithreaded parent. Currently only supported by pthread_support.c.
- (Similar code should work on Solaris or Irix, but it hasn't been tried.)
+NO_HANDLE_FORK (Unix only) Do not attempt to make GC_malloc() work in
+ a child process fork()'ed from a multi-threaded parent. (Might be required
+ if pthread_atfork is missing.)
TEST_WITH_SYSTEM_MALLOC Causes gctest to allocate (and leak) large
chunks of memory with the standard system malloc. This will cause the root
# define IF_CANCEL(x) /* empty */
#endif
+#if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
+ && !defined(HANDLE_FORK) && !defined(NO_HANDLE_FORK) \
+ && !defined(HURD) && !defined(NACL) && !defined(PLATFORM_ANDROID)
+ /* Attempts (where supported) to make GC_malloc work in a child */
+ /* process fork'ed from a multi-threaded parent. */
+# define HANDLE_FORK
+#endif
+
#if !defined(USE_MARK_BITS) && !defined(USE_MARK_BYTES) \
&& defined(PARALLEL_MARK)
/* Minimize compare-and-swap usage. */