summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-06-24 13:04:32 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-06-24 13:04:32 +0400
commit770355f3050d285953bf69002a0b2c7fe885698f (patch)
tree6c24195e16548bcb1804f438ee733986e524ef0c /misc.c
parent215d710e39b5f9df733525b97ff8c39cb659c7b0 (diff)
downloadbdwgc-770355f3050d285953bf69002a0b2c7fe885698f.tar.gz
Turn off GC_LOOP_ON_ABORT functionality if GC compiled with NO_DEBUGGING
* misc.c (looping_handler, installed_looping_handler): Do not define if NO_DEBUGGING. * misc.c (maybe_install_looping_handler): Define as an empty macro if NO_DEBUGGING. * misc.c (GC_on_abort): Do not test "GC_LOOP_ON_ABORT" environment variable if GC_LOOP_ON_ABORT.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/misc.c b/misc.c
index deecc0ef..6e6eab22 100644
--- a/misc.c
+++ b/misc.c
@@ -642,11 +642,13 @@ STATIC void GC_exit_check(void)
GC_gcollect();
}
-#ifdef UNIX_LIKE
+#if defined(UNIX_LIKE) && !defined(NO_DEBUGGING)
static void looping_handler(int sig)
{
GC_err_printf("Caught signal %d: looping in handler\n", sig);
- for (;;) {}
+ for (;;) {
+ /* empty */
+ }
}
static GC_bool installed_looping_handler = FALSE;
@@ -1492,7 +1494,8 @@ GC_API GC_warn_proc GC_CALL GC_get_warn_proc(void)
(void)WRITE(GC_stderr, (void *)("\n"), 1);
}
- if (GETENV("GC_LOOP_ON_ABORT") != NULL) {
+# ifndef NO_DEBUGGING
+ if (GETENV("GC_LOOP_ON_ABORT") != NULL) {
/* In many cases it's easier to debug a running process. */
/* It's arguably nicer to sleep, but that makes it harder */
/* to look at the thread if the debugger doesn't know much */
@@ -1500,7 +1503,8 @@ GC_API GC_warn_proc GC_CALL GC_get_warn_proc(void)
for(;;) {
/* Empty */
}
- }
+ }
+# endif
}
#endif /* !SMALL_CONFIG */