diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-12-11 09:28:12 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-12-11 15:28:38 +0400 |
commit | 1c3d8e3f6a963c32c5365ff52a9ebc6d65c088ce (patch) | |
tree | 090b306ecc7cb3126639fe1177964531e72df903 /dbg_mlc.c | |
parent | db6df7562ce3dbf5e4eb4269229dee780f489440 (diff) | |
download | bdwgc-1c3d8e3f6a963c32c5365ff52a9ebc6d65c088ce.tar.gz |
Replace GC_log/err_printf() followed by ABORT with ABORT_ARGn()
(code refactoring)
* allchblk.c (GC_freehblk): Replace GC_COND_LOG_PRINTF (or
GC_log_printf, or GC_err_printf) followed by ABORT with ABORT_ARG<n>
(where 'n' is the number of arguments matching format string).
* alloc.c (GC_check_fl_marks): Likewise.
* dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change,
GC_debug_free, GC_debug_realloc): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap, PROTECT,
GC_write_fault_handler, GC_mprotect_thread): Likewise.
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Likewise.
* ptr_chck.c (GC_default_same_obj_print_proc,
GC_default_is_valid_displacement_print_proc,
GC_default_is_visible_print_proc): Likewise.
* specific.c (GC_check_tsd_marks): Likewise.
* win32_threads.c (GC_register_my_thread_inner): Likewise.
* include/private/gc_priv.h (ABORT_ARG1, ABORT_ARG2, ABORT_ARG3): New
macro.
Diffstat (limited to 'dbg_mlc.c')
-rw-r--r-- | dbg_mlc.c | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -603,13 +603,11 @@ GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb, hdr * hhdr; if (q == 0) { - GC_err_printf("Bad argument: %p to GC_debug_change_stubborn\n", p); - ABORT("GC_debug_change_stubborn: bad arg"); + ABORT_ARG1("GC_debug_change_stubborn: bad arg", ": %p", p); } hhdr = HDR(q); if (hhdr -> hb_obj_kind != STUBBORN) { - GC_err_printf("GC_debug_change_stubborn arg not stubborn: %p\n", p); - ABORT("GC_debug_change_stubborn: arg not stubborn"); + ABORT_ARG1("GC_debug_change_stubborn: arg not stubborn", ": %p", p); } GC_change_stubborn(q); } @@ -620,13 +618,12 @@ GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb, hdr * hhdr; if (q == 0) { - GC_err_printf("Bad argument: %p to GC_debug_end_stubborn_change\n", p); - ABORT("GC_debug_end_stubborn_change: bad arg"); + ABORT_ARG1("GC_debug_end_stubborn_change: bad arg", ": %p", p); } hhdr = HDR(q); if (hhdr -> hb_obj_kind != STUBBORN) { - GC_err_printf("debug_end_stubborn_change arg not stubborn: %p\n", p); - ABORT("GC_debug_end_stubborn_change: arg not stubborn"); + ABORT_ARG1("GC_debug_end_stubborn_change: arg not stubborn", + ": %p", p); } GC_end_stubborn_change(q); } @@ -772,8 +769,7 @@ GC_API void GC_CALL GC_debug_free(void * p) base = GC_base(p); if (base == 0) { - GC_err_printf("Attempt to free invalid pointer %p\n", p); - ABORT("Invalid pointer passed to free()"); + ABORT_ARG1("Invalid pointer passed to free()", ": %p", p); } if ((ptr_t)p - (ptr_t)base != sizeof(oh)) { GC_err_printf( @@ -850,8 +846,7 @@ GC_API void * GC_CALL GC_debug_realloc(void * p, size_t lb, GC_EXTRA_PARAMS) base = GC_base(p); if (base == 0) { - GC_err_printf("Attempt to reallocate invalid pointer %p\n", p); - ABORT("Invalid pointer passed to realloc()"); + ABORT_ARG1("Invalid pointer passed to realloc()", ": %p", p); } if ((ptr_t)p - (ptr_t)base != sizeof(oh)) { GC_err_printf( |