diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-11-08 21:51:10 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-11-08 22:15:03 +0400 |
commit | 60615a56f5a82e8d214d2c8267363cd1bc2a70d7 (patch) | |
tree | fe9f0070a366fc787e0ade6c6c209aac6c72868c /gcj_mlc.c | |
parent | 3ae3bfe965926c3fd940bcef4bfe8dcdf1613ddc (diff) | |
download | bdwgc-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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; |