summaryrefslogtreecommitdiff
path: root/gcj_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-08 21:51:10 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-11-08 22:15:03 +0400
commit60615a56f5a82e8d214d2c8267363cd1bc2a70d7 (patch)
treefe9f0070a366fc787e0ade6c6c209aac6c72868c /gcj_mlc.c
parent3ae3bfe965926c3fd940bcef4bfe8dcdf1613ddc (diff)
downloadbdwgc-60615a56f5a82e8d214d2c8267363cd1bc2a70d7.tar.gz
Improve GC error printing atomicity in GC_debug_X and GC_print_obj
* dbg_mlc.c (GC_generate_random_backtrace_no_gc): Refine comment. * dbg_mlc.c (GC_print_type): Replace multiple code fragments calling GC_err_puts with a single invocation of GC_err_puts (or GC_err_printf) at the routine end (code refactoring). * dbg_mlc.c (IF_NOT_SHORTDBG_HDRS, COMMA_IFNOT_SHORTDBG_HDRS): New macro (used by GC_print_obj). * dbg_mlc.c (GC_print_obj, GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable): Replace adjacent GC_err_printf and GC_err_puts calls with a single GC_err_printf invocation (for output atomicity). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * os_dep.c (GC_register_data_segments): Likewise. * dbg_mlc.c (GC_malloc_stubborn): Fix printed function name.
Diffstat (limited to 'gcj_mlc.c')
-rw-r--r--gcj_mlc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcj_mlc.c b/gcj_mlc.c
index ea5c8816..d2dcbb58 100644
--- a/gcj_mlc.c
+++ b/gcj_mlc.c
@@ -220,10 +220,8 @@ GC_API void * GC_CALL GC_debug_gcj_malloc(size_t lb,
if (result == 0) {
GC_oom_func oom_fn = GC_oom_fn;
UNLOCK();
- GC_err_printf("GC_debug_gcj_malloc(%lu, %p) returning NULL (",
- (unsigned long)lb, ptr_to_struct_containing_descr);
- GC_err_puts(s);
- GC_err_printf(":%d)\n", i);
+ GC_err_printf("GC_debug_gcj_malloc(%lu, %p) returning NULL (%s:%d)\n",
+ (unsigned long)lb, ptr_to_struct_containing_descr, s, i);
return((*oom_fn)(lb));
}
*((void **)((ptr_t)result + sizeof(oh))) = ptr_to_struct_containing_descr;