From: ivmai Date: Wed, 18 May 2011 08:55:41 +0000 (+0000) Subject: 2011-05-18 Ivan Maidanski X-Git-Tag: gc7_2alpha6~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f59c2f6edec882278860b1fef554671502994293;p=gc 2011-05-18 Ivan Maidanski * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing only if GC_print_stats; print errors using GC_err_printf. * checksums.c (GC_check_blocks): Join adjacent printf() calls into a single one. --- diff --git a/ChangeLog b/ChangeLog index bb57cc5c..2bf04567 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-05-18 Ivan Maidanski + + * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing + only if GC_print_stats; print errors using GC_err_printf. + * checksums.c (GC_check_blocks): Join adjacent printf() calls into + a single one. + 2011-05-17 Ivan Maidanski * pthread_support.c (pthread_join): Add assertion (check thread is diff --git a/checksums.c b/checksums.c index 0400697d..b93bcf98 100644 --- a/checksums.c +++ b/checksums.c @@ -165,13 +165,14 @@ STATIC void GC_check_blocks(void) GC_bytes_in_used_blocks = 0; GC_apply_to_all_blocks(GC_add_block, (word)0); - GC_log_printf( - "GC_bytes_in_used_blocks = %lu, bytes_in_free_blocks = %lu ", - (unsigned long)GC_bytes_in_used_blocks, - (unsigned long)bytes_in_free_blocks); - GC_log_printf("GC_heapsize = %lu\n", (unsigned long)GC_heapsize); + if (GC_print_stats) + GC_log_printf("GC_bytes_in_used_blocks = %lu," + " bytes_in_free_blocks = %lu, heapsize = %lu\n", + (unsigned long)GC_bytes_in_used_blocks, + (unsigned long)bytes_in_free_blocks, + (unsigned long)GC_heapsize); if (GC_bytes_in_used_blocks + bytes_in_free_blocks != GC_heapsize) { - GC_log_printf("LOST SOME BLOCKS!!\n"); + GC_err_printf("LOST SOME BLOCKS!!\n"); } } @@ -203,19 +204,20 @@ void GC_check_dirty(void) } } out: - GC_log_printf("Checked %lu clean and %lu dirty pages\n", - (unsigned long)GC_n_clean, (unsigned long)GC_n_dirty); + if (GC_print_stats) + GC_log_printf("Checked %lu clean and %lu dirty pages\n", + (unsigned long)GC_n_clean, (unsigned long)GC_n_dirty); if (GC_n_dirty_errors > 0) { - GC_log_printf("Found %d dirty bit errors (%d were faulted)\n", + GC_err_printf("Found %d dirty bit errors (%d were faulted)\n", GC_n_dirty_errors, GC_n_faulted_dirty_errors); } if (GC_n_changed_errors > 0) { - GC_log_printf("Found %lu changed bit errors\n", + GC_err_printf("Found %lu changed bit errors\n", (unsigned long)GC_n_changed_errors); - GC_log_printf( + GC_err_printf( "These may be benign (provoked by nonpointer changes)\n"); # ifdef THREADS - GC_log_printf( + GC_err_printf( "Also expect 1 per thread currently allocating a stubborn obj\n"); # endif }