From edde77ef4675c44214af54184b59ab6b371b9dc1 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 26 Oct 2016 11:44:37 +0300 Subject: [PATCH] Eliminate unreachable PROC/DEFAULT_VDB GC_printf calls in gctest main() * 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 | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/test.c b/tests/test.c index 4e00ea3..59bb665 100644 --- a/tests/test.c +++ b/tests/test.c @@ -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) { -- 2.7.4