From: Ivan Maidanski Date: Sun, 24 Jun 2012 09:04:32 +0000 (+0400) Subject: Turn off GC_LOOP_ON_ABORT functionality if GC compiled with NO_DEBUGGING X-Git-Tag: gc7_4_0~266 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=770355f3050d285953bf69002a0b2c7fe885698f;p=gc 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. --- 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 */