summaryrefslogtreecommitdiff
path: root/headers.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-12 21:56:57 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-11-12 21:56:57 +0400
commit438309a49f04d28d2dd441c701dfa5711095b244 (patch)
tree9c143df76a59249898c03cb294d5799afb2ab620 /headers.c
parent608fe467d3d21bb5aa9ed7fd11e360a3d0705b21 (diff)
downloadbdwgc-438309a49f04d28d2dd441c701dfa5711095b244.tar.gz
Replace conditional GC_log_printf calls with GC_COND/VERBOSE_LOG_PRINTF
(code refactoring) * allchblk.c (GC_freehblk): Replace "if (GC_print_stats) GC_log_printf" with GC_COND_LOG_PRINTF. * alloc.c (GC_timeout_stop_func, GC_maybe_gc, GC_try_to_collect_inner, GC_stopped_mark, GC_finish_collection, GC_expand_hp_inner, GC_collect_or_expand): Likewise. * backgraph.c (backwards_height, GC_print_back_graph_stats): Likewise. * checksums.c (GC_check_blocks, GC_check_dirty): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * finalize.c (GC_general_register_disappearing_link, GC_register_finalizer_inner): Likewise. * gcj_mlc.c (GC_init_gcj_malloc): Likewise. * headers.c (GC_scratch_alloc): Likewise. * mark.c (GC_mark_some_inner, GC_mark_some, GC_signal_mark_stack_overflow, GC_return_mark_stack, alloc_mark_stack): Likewise. * obj_map.c (GC_add_map_entry): Likewise. * os_dep.c (GC_get_maps, backing_store_base_from_proc, GC_register_data_segments, detect_GetWriteWatch, GC_add_current_malloc_heap, GC_remap, PROTECT, GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Likewise. * pthread_stop_world.c (GC_stop_world, GC_start_world, GC_stop_init): Likewise. * pthread_support.c (start_mark_threads, GC_thr_init): Likewise. * win32_threads.c (GC_register_my_thread_inner, GC_thr_init): Likewise. * alloc.c (GC_finish_collection): Replace "if (GC_print_stats == VERBOSE) GC_log_printf" with GC_VERBOSE_LOG_PRINTF. * blacklst.c (GC_promote_black_lists): Likewise. * darwin_stop_world.c (GC_push_all_stacks): Likewise. * mark.c (GC_mark_local, GC_do_parallel_mark): Likewise. * os_dep.c (GC_dirty_init): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * win32_threads.c (GC_push_all_stacks): Likewise. * include/private/gc_priv.h (GC_COND_LOG_PRINTF, GC_VERBOSE_LOG_PRINTF): New macro (check GC_print_stats and call GC_log_printf if enabled). * os_dep.c (GC_dirty_init, GC_read_dirty): Replace "if (GC_print_stats) GC_err_printf" with WARN.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/headers.c b/headers.c
index 47cc526e..d650fe78 100644
--- a/headers.c
+++ b/headers.c
@@ -144,8 +144,7 @@ GC_INNER ptr_t GC_scratch_alloc(size_t bytes)
result = (ptr_t)GET_MEM(bytes_to_get);
GC_add_to_our_memory(result, bytes_to_get);
if (result == 0) {
- if (GC_print_stats)
- GC_log_printf("Out of memory - trying to allocate less\n");
+ GC_COND_LOG_PRINTF("Out of memory - trying to allocate less\n");
scratch_free_ptr -= bytes;
bytes_to_get = bytes;
# ifdef USE_MMAP