]> granicus.if.org Git - gc/commitdiff
Turn off GC_LOOP_ON_ABORT functionality if GC compiled with NO_DEBUGGING
authorIvan Maidanski <ivmai@mail.ru>
Sun, 24 Jun 2012 09:04:32 +0000 (13:04 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 24 Jun 2012 09:04:32 +0000 (13:04 +0400)
* 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.

misc.c

diff --git a/misc.c b/misc.c
index deecc0effe5886fb36de5d7c2b75c79003178af0..6e6eab22e2e5ee732c87ccb797736e2ed42141b7 100644 (file)
--- 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 */