summaryrefslogtreecommitdiff
path: root/blacklst.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-11 11:26:38 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-11-11 11:26:38 +0400
commit653fb51a5a9d45b7833d5b3a09d8d2fa596125a3 (patch)
tree4b0831e78729fc1ca61a59416590e58314c2705c /blacklst.c
parent3d84e7d8f7985b2a13d0ac591be37dbed847388a (diff)
downloadbdwgc-653fb51a5a9d45b7833d5b3a09d8d2fa596125a3.tar.gz
Improve GC output atomicity in GC_print_obj, GC_print_all_errors
(as well as in GC_print_backtrace, GC_print_all_smashed_proc) * blacklst.c (GC_default_print_heap_obj_proc): Refine printed message; output object kind; output trailing "\n". * reclaim.c (GC_print_all_errors): Do not print object kind (before GC_print_heap_obj call). * dbg_mlc.c (GC_print_backtrace): Remove redundant printed "\n" after GC_print_heap_obj call. * reclaim.c (GC_print_all_errors): Likewise. * dbg_mlc.c (GC_print_type): Remove (move code to GC_print_obj replacing "p" local variable with "q"). * dbg_mlc.c (GC_print_obj): Merge adjacent GC_err_printf and GC_err_puts invocation into a single GC_err_printf one (for output atomicity). * dbg_mlc.c (GC_print_all_smashed_proc): Print number of found objects first. * reclaim.c (GC_print_all_errors): Likewise. * dbg_mlc.c (GC_print_all_smashed_proc): Remove printed "\n" at list end. * include/private/gc_priv.h (GC_print_heap_obj, GC_printf): Refine comments.
Diffstat (limited to 'blacklst.c')
-rw-r--r--blacklst.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/blacklst.c b/blacklst.c
index 778b2af6..11556a4a 100644
--- a/blacklst.c
+++ b/blacklst.c
@@ -57,8 +57,12 @@ STATIC void GC_clear_bl(word *);
GC_INNER void GC_default_print_heap_obj_proc(ptr_t p)
{
ptr_t base = GC_base(p);
- GC_err_printf("start: %p, appr. length: %lu",
- base, (unsigned long)GC_size(base));
+ int kind = HDR(base)->hb_obj_kind;
+
+ GC_err_printf("object at %p of appr. %lu bytes (%s)\n",
+ base, (unsigned long)GC_size(base),
+ kind == PTRFREE ? "atomic" :
+ IS_UNCOLLECTABLE(kind) ? "uncollectable" : "composite");
}
GC_INNER void (*GC_print_heap_obj)(ptr_t p) = GC_default_print_heap_obj_proc;