From: Ivan Maidanski Date: Sat, 28 Jan 2012 17:39:28 +0000 (+0400) Subject: gctest: Output marker threads count at end X-Git-Tag: gc7_3alpha2~169 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=774560b0d6aeb5e77c7d7c634ffcc3fb6264fe3e;p=gc gctest: Output marker threads count at end * tests/test.c (run_one_test): Adjust printf format specifier. * tests/test.c (main): Move printf for completed collections number to check_heap_stats(). * tests/test.c (check_heap_stats): Print number of marker threads. --- diff --git a/tests/test.c b/tests/test.c index 22e5118a..cbbee258 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1092,7 +1092,7 @@ void run_one_test(void) } collectable_count += 1; if (GC_size(GC_malloc(0)) != MIN_WORDS * sizeof(GC_word)) { - GC_printf("GC_malloc(0) failed: GC_size returns %ld\n", + GC_printf("GC_malloc(0) failed: GC_size returns %lu\n", (unsigned long)GC_size(GC_malloc(0))); FAIL; } @@ -1396,7 +1396,11 @@ void check_heap_stats(void) # ifdef THREADS GC_unregister_my_thread(); /* just to check it works (for main) */ # endif - GC_printf("Collector appears to work\n"); + GC_printf("Completed %u collections", (unsigned)GC_get_gc_no()); +# ifdef PARALLEL_MARK + GC_printf(" (using %d marker threads)", GC_get_parallel() + 1); +# endif + GC_printf("\n" "Collector appears to work\n"); } #if defined(MACOS) @@ -1770,7 +1774,6 @@ int main(void) check_heap_stats(); (void)fflush(stdout); pthread_attr_destroy(&attr); - GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no()); # ifdef PTW32_STATIC_LIB pthread_win32_thread_detach_np (); pthread_win32_process_detach_np ();