From ff55290a3bcab7f9763d74214c03a7b65646f990 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 25 Oct 2017 11:45:38 +0300 Subject: Do not use system clock consistently if NO_CLOCK Issue #139 (bdwgc). * alloc.c (GC_try_to_collect_inner, world_stopped_total_time, world_stopped_total_divisor, MAX_TOTAL_TIME_DIVISOR, GC_stopped_mark): Replace "ifndef SMALL_CONFIG" with "ifndef NO_CLOCK". * reclaim.c (GC_reclaim_all): Likewise. * alloc.c (GC_finish_collection): Replace "ifndef SMALL_CONFIG" with "ifndef NO_CLOCK" except for GC_print_finalization_stats invocation. * doc/README.macros (NO_CLOCK): Document. * include/private/gc_priv.h (CLOCK_TYPE, GET_TIME, MS_TIME_DIFF): Do not define if NO_CLOCK. * include/private/gc_priv.h (GC_print_stats): Define as a macro (to 0) only if both NO_CLOCK and SMALL_CONFIG are defined. * misc.c (GC_print_stats): Do not define if both NO_CLOCK and SMALL_CONFIG are defined. * misc.c (GC_init): Do not set GC_print_stats only if both NO_CLOCK and SMALL_CONFIG are defined. * tests/test.c (run_one_test): Do not define start_time, reverse_time, time_diff local variables (and do not use GET_TIME, MS_TIME_DIFF) if NO_CLOCK is defined. --- reclaim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reclaim.c') diff --git a/reclaim.c b/reclaim.c index 5bd69979..ec20a17a 100644 --- a/reclaim.c +++ b/reclaim.c @@ -711,7 +711,7 @@ GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old) struct obj_kind * ok; struct hblk ** rlp; struct hblk ** rlh; -# ifndef SMALL_CONFIG +# ifndef NO_CLOCK CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */ if (GC_print_stats == VERBOSE) @@ -739,7 +739,7 @@ GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old) } } } -# ifndef SMALL_CONFIG +# ifndef NO_CLOCK if (GC_print_stats == VERBOSE) { CLOCK_TYPE done_time; -- cgit v1.2.1