diff options
Diffstat (limited to 'checksums.c')
-rw-r--r-- | checksums.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/checksums.c b/checksums.c index e2e5a69f..3f2af938 100644 --- a/checksums.c +++ b/checksums.c @@ -97,8 +97,6 @@ int GC_n_changed_errors = 0; int GC_n_clean = 0; int GC_n_dirty = 0; -GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h); - STATIC void GC_update_check_page(struct hblk *h, int index) { page_entry *pe = GC_sums + index; @@ -110,7 +108,7 @@ STATIC void GC_update_check_page(struct hblk *h, int index) pe -> new_sum = GC_checksum(h); # if !defined(MSWIN32) && !defined(MSWINCE) if (pe -> new_sum != 0x80000000 && !GC_page_was_ever_dirty(h)) { - GC_printf("GC_page_was_ever_dirty(%p) is wrong\n", h); + GC_err_printf("GC_page_was_ever_dirty(%p) is wrong\n", h); } # endif if (GC_page_was_dirty(h)) { @@ -165,12 +163,14 @@ STATIC void GC_check_blocks(void) GC_bytes_in_used_blocks = 0; GC_apply_to_all_blocks(GC_add_block, (word)0); - GC_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_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_printf("LOST SOME BLOCKS!!\n"); + GC_err_printf("LOST SOME BLOCKS!!\n"); } } @@ -202,19 +202,21 @@ void GC_check_dirty(void) } } out: - GC_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_printf("Found %d dirty bit errors (%d were faulted)\n", - GC_n_dirty_errors, GC_n_faulted_dirty_errors); + 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_printf("Found %lu changed bit errors\n", - (unsigned long)GC_n_changed_errors); - GC_printf("These may be benign (provoked by nonpointer changes)\n"); + GC_err_printf("Found %lu changed bit errors\n", + (unsigned long)GC_n_changed_errors); + GC_err_printf( + "These may be benign (provoked by nonpointer changes)\n"); # ifdef THREADS - GC_printf( - "Also expect 1 per thread currently allocating a stubborn obj.\n"); + GC_err_printf( + "Also expect 1 per thread currently allocating a stubborn obj\n"); # endif } for (i = 0; i < GC_n_faulted; ++i) { |