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 /ptr_chck.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 'ptr_chck.c')
-rw-r--r-- | ptr_chck.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -20,8 +20,8 @@ STATIC void GC_CALLBACK GC_default_same_obj_print_proc(void * p, void * q) { - GC_err_printf("%p and %p are not in the same object\n", p, q); - ABORT("GC_same_obj test failed"); + ABORT_ARG2("GC_same_obj test failed", + ": %p and %p are not in the same object", p, q); } void (GC_CALLBACK *GC_same_obj_print_proc) (void *, void *) @@ -102,8 +102,7 @@ fail: STATIC void GC_CALLBACK GC_default_is_valid_displacement_print_proc (void *p) { - GC_err_printf("%p does not point to valid object displacement\n", p); - ABORT("GC_is_valid_displacement test failed"); + ABORT_ARG1("GC_is_valid_displacement test failed", ": %p not valid", p); } void (GC_CALLBACK *GC_is_valid_displacement_print_proc)(void *) = @@ -152,8 +151,7 @@ fail: STATIC void GC_CALLBACK GC_default_is_visible_print_proc(void * p) { - GC_err_printf("%p is not a GC visible pointer location\n", p); - ABORT("GC_is_visible test failed"); + ABORT_ARG1("GC_is_visible test failed", ": %p not GC-visible", p); } void (GC_CALLBACK *GC_is_visible_print_proc)(void * p) = |