summaryrefslogtreecommitdiff
path: root/checksums.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-18 10:55:41 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:59 +0200
commitf59c2f6edec882278860b1fef554671502994293 (patch)
tree3284bbb13e4162b41e25a475fd43ed490927e077 /checksums.c
parent77ffb1ff58523f4ee461e1d1ae1a1ae1ddd9b601 (diff)
2011-05-18 Ivan Maidanski <ivmai@mail.ru>
* 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.
Diffstat (limited to 'checksums.c')
-rw-r--r--checksums.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/checksums.c b/checksums.c
index 0400697..b93bcf9 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
}