diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-05-03 08:18:11 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-05-03 08:18:11 +0300 |
commit | 2bd99806ec080e06a5f8712a8e7e6c14b1bda23c (patch) | |
tree | 882cb9d7ccefac77370807ee516ae2ca48767f3e | |
parent | 1cb1170d6092f8bc48c87af47fbea7915cf495d3 (diff) | |
download | bdwgc-2bd99806ec080e06a5f8712a8e7e6c14b1bda23c.tar.gz |
More clear message about total duration of full collections in gctest
* tests/gctest.c [!NO_CLOCK] (check_heap_stats): Print value of
GC_get_full_gc_total_time() on a standalone line (and with the proper
message).
-rw-r--r-- | tests/gctest.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/gctest.c b/tests/gctest.c index 3110a111..7b00f834 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -2123,16 +2123,15 @@ void check_heap_stats(void) # ifdef THREADS (void)GC_unregister_my_thread(); /* just to check it works (for main) */ # endif -# ifdef NO_CLOCK - GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no()); -# elif !defined(PARALLEL_MARK) - GC_printf("Completed %u collections in %lu ms\n", - (unsigned)GC_get_gc_no(), GC_get_full_gc_total_time()); + +# ifndef NO_CLOCK + GC_printf("Full collections took %lu ms\n", GC_get_full_gc_total_time()); +# endif +# ifdef PARALLEL_MARK + GC_printf("Completed %u collections (using %d marker threads)\n", + (unsigned)GC_get_gc_no(), GC_get_parallel() + 1); # else - GC_printf("Completed %u collections in %lu ms" - " (using %d marker threads)\n", - (unsigned)GC_get_gc_no(), GC_get_full_gc_total_time(), - GC_get_parallel() + 1); + GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no()); # endif GC_printf("Collector appears to work\n"); } |