]> granicus.if.org Git - gc/commitdiff
Eliminate unreachable PROC/DEFAULT_VDB GC_printf calls in gctest main()
authorIvan Maidanski <ivmai@mail.ru>
Wed, 26 Oct 2016 08:44:37 +0000 (11:44 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 26 Oct 2016 08:44:37 +0000 (11:44 +0300)
* tests/test.c [!GC_WIN32_THREADS && !GC_PTHREADS && !NO_INCREMENTAL
&& (MPROTECT_VDB || PROC_VDB || GWW_VDB) && !MAKE_BACK_GRAPH &&] (main):
Remove unreachable GC_printf call about DEFAULT_VDB; remove extra check
of GWW_VDB case.
* tests/test.c [GC_PTHREADS && MPROTECT_VDB && !REDIRECT_MALLOC
&& !MAKE_BACK_GRAPH && !USE_PROC_FOR_LIBRARIES && !NO_INCREMENTAL]
(main): Remove extra check of MPROTECT_VDB case; remove unreachable
GC_printf calls about PROC_VDB and DEFAULT_VDB.

tests/test.c

index 4e00ea3286f94278b324b928a162b208eb7900a0..59bb66505702d9835c1231d559c1952f149f15b9 100644 (file)
@@ -1715,15 +1715,11 @@ void GC_CALLBACK warn_proc(char *msg, GC_word p)
       GC_printf("Switched to incremental mode\n");
 #     if defined(MPROTECT_VDB)
         GC_printf("Emulating dirty bits with mprotect/signals\n");
-#     else
-#       ifdef PROC_VDB
-          GC_printf("Reading dirty bits from /proc\n");
-#       elif defined(GWW_VDB)
-          GC_printf("Using GetWriteWatch-based implementation\n");
-#       else
-          GC_printf("Using DEFAULT_VDB dirty bit implementation\n");
-#       endif
-#      endif
+#     elif defined(PROC_VDB)
+        GC_printf("Reading dirty bits from /proc\n");
+#     else /* GWW_VDB */
+        GC_printf("Using GetWriteWatch-based implementation\n");
+#     endif
 #   endif
     run_one_test();
     check_heap_stats();
@@ -1979,20 +1975,12 @@ int main(void)
         }
 #   endif
     n_tests = 0;
-#   if (defined(MPROTECT_VDB)) && !defined(REDIRECT_MALLOC) \
+#   if defined(MPROTECT_VDB) && !defined(REDIRECT_MALLOC) \
             && !defined(MAKE_BACK_GRAPH) && !defined(USE_PROC_FOR_LIBRARIES) \
             && !defined(NO_INCREMENTAL)
         GC_enable_incremental();
         GC_printf("Switched to incremental mode\n");
-#     if defined(MPROTECT_VDB)
         GC_printf("Emulating dirty bits with mprotect/signals\n");
-#     else
-#       ifdef PROC_VDB
-          GC_printf("Reading dirty bits from /proc\n");
-#       else
-          GC_printf("Using DEFAULT_VDB dirty bit implementation\n");
-#       endif
-#     endif
 #   endif
     GC_set_warn_proc(warn_proc);
     if ((code = pthread_key_create(&fl_key, 0)) != 0) {