summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-04-03 06:37:33 +0200
committerIvan Maidanski <ivmai@mail.ru>2012-04-03 06:37:33 +0200
commitc20772b400213da4a2776319740cb851487c4ed0 (patch)
tree9002cb88b8e0c5fc8dd1d7da7d516e43e2f120dd
parentcad34343056a5f9b4598b5ddc36ed8ce0e264399 (diff)
Regenerate configure; update ChangeLog
-rw-r--r--ChangeLog66
-rwxr-xr-xconfigure19
-rw-r--r--include/private/config.h.in6
3 files changed, 91 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b1f10cc..0e16acf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,69 @@
+2012-04-02 Ivan Maidanski <ivmai@mail.ru>
+
+ * configure: Regenerate.
+ * include/private/config.h.in : Likewise.
+
+2012-04-02 Ivan Maidanski <ivmai@mail.ru>
+
+ * doc/README.macros (NO_HANDLE_FORK): Replace back with HANDLE_FORK
+ and update.
+ * include/private/gcconfig.h (CAN_HANDLE_FORK): Define also for Darwin
+ in case of MPROTECT_VDB.
+ * misc.c (GC_set_handle_fork): Handle Darwin properly; add comment.
+ * os_dep.c (GC_dirty_init): Do not turn on GC_dirty_maintained for
+ Darwin if GC_handle_fork is on; add comment; remove FIXME.
+ * pthread_support.c (GC_fork_prepare_proc): Remove WARN for Darwin
+ (since GC_dirty_maintained is off in that case).
+ * pthread_support.c (GC_fork_child_proc): Remove comment (for Darwin).
+
+2012-04-02 Ivan Maidanski <ivmai@mail.ru>
+
+ * include/gc.h (GC_set_handle_fork): New API function.
+ * misc.c (GC_set_handle_fork): Likewise.
+ * include/private/gc_priv.h (GC_handle_fork): New internal variable
+ declaration (only if CAN_HANDLE_FORK).
+ * misc.c (GC_handle_fork): New internal variable (defined only if
+ CAN_HANDLE_FORK); initialize to TRUE if HANDLE_FORK.
+ * include/private/gcconfig.h (HANDLE_FORK): Replace with
+ CAN_HANDLE_FORK.
+ * pthread_support.c (HANDLE_FORK): Likewise.
+ * win32_threads.c (HANDLE_FORK): Likewise.
+ * include/private/gcconfig.h (CAN_HANDLE_FORK): Always define macro if
+ HANDLE_FORK.
+ * pthread_support.c (GC_thr_init): Replace HANDLE_FORK with
+ CAN_HANDLE_FORK; call pthread_atfork only if GC_handle_fork; update
+ the comment.
+ * win32_threads.c (GC_thr_init): Likewise.
+ * tests/test.c (NO_TEST_HANDLE_FORK): Define new macro if fork
+ handling is not supported (or is a no-op) on the target.
+ * tests/test.c (INIT_FORK_SUPPORT): New macro (invoke
+ GC_set_handle_fork unless NO_TEST_HANDLE_FORK).
+ * tests/test.c (GC_OPT_INIT): New macro (defined to GC_INIT or empty).
+ * tests/test.c (GC_COND_INIT): Use INIT_FORK_SUPPORT and GC_OPT_INIT.
+ * tests/test.c (run_one_test): Test NO_TEST_HANDLE_FORK (instead of
+ target-specific macros).
+ * win32_threads.c (GC_remove_all_threads_but_me, GC_fork_prepare_proc,
+ GC_fork_parent_proc, GC_fork_child_proc): Do not test GC_PTHREADS.
+ * configure.ac (HANDLE_FORK, NO_HANDLE_FORK): Update message.
+
+2012-02-20 Ivan Maidanski <ivmai@mail.ru>
+
+ * pthread_support.c (GC_thr_init): Abort on pthread_atfork failure
+ (only if HANDLE_FORK).
+
+2012-03-30 Ivan Maidanski <ivmai@mail.ru>
+
+ * include/gc.h (GC_HAVE_GET_HEAP_USAGE_SAFE): Remove public HAVE_
+ macro (since function availability could be determined by autotools);
+ update the comment.
+
+2012-03-27 Andy Wingo <wingo@pobox.com>
+
+ * configure.ac: Add --enable-handle-fork option; if explicitly passed,
+ enables or disables the pthread_atfork support; if not passed, the
+ default, as determined by gcconfig.h, is to enable HANDLE_FORK if it
+ is supported on the target platform.
+
2012-03-28 Ivan Maidanski <ivmai@mail.ru>
* doc/README.solaris2 (SOLARIS THREADS): Update.
diff --git a/configure b/configure
index 5c86de2..92eabdb 100755
--- a/configure
+++ b/configure
@@ -809,6 +809,7 @@ enable_java_finalization
enable_atomic_uncollectable
enable_redirect_malloc
enable_large_config
+enable_handle_fork
enable_gc_assertions
enable_munmap
with_libatomic_ops
@@ -1473,6 +1474,8 @@ Optional Features:
--enable-redirect-malloc
Redirect malloc and friends to GC routines
--enable-large-config Optimize for large (> 100 MB) heap or root set
+ --enable-handle-fork Attempt to ensure a usable collector after fork() in
+ multi-threaded programs.
--enable-gc-assertions collector-internal assertion checking
--enable-munmap=N return page to the os if empty for N collections
@@ -16410,6 +16413,22 @@ $as_echo "#define LARGE_CONFIG 1" >>confdefs.h
fi
+# Check whether --enable-handle-fork was given.
+if test "${enable_handle_fork+set}" = set; then :
+ enableval=$enable_handle_fork;
+fi
+
+
+if test "${enable_handle_fork}" = yes; then
+
+$as_echo "#define HANDLE_FORK 1" >>confdefs.h
+
+elif test "${enable_handle_fork}" = no; then
+
+$as_echo "#define NO_HANDLE_FORK 1" >>confdefs.h
+
+fi
+
if test -n "${with_cross_host}"; then
$as_echo "#define NO_CLOCK 1" >>confdefs.h
diff --git a/include/private/config.h.in b/include/private/config.h.in
index 61605d3..fb35475 100644
--- a/include/private/config.h.in
+++ b/include/private/config.h.in
@@ -93,6 +93,9 @@
/* Define to support Win32 threads. */
#undef GC_WIN32_THREADS
+/* Define to install pthread_atfork() handlers by default. */
+#undef HANDLE_FORK
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -151,6 +154,9 @@
/* Define to make the collector not allocate executable memory by default. */
#undef NO_EXECUTE_PERMISSION
+/* Prohibit installation of pthread_atfork() handlers. */
+#undef NO_HANDLE_FORK
+
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O