]> granicus.if.org Git - gc/commit
Fix gctest in leak-finding mode
authorIvan Maidanski <ivmai@mail.ru>
Thu, 7 Jun 2018 09:09:57 +0000 (12:09 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 8 Jul 2018 21:06:25 +0000 (00:06 +0300)
commitc147dcba76e8dfd49cd12a0166b968d7a0d6451e
tree7daca39cfff5d2d800719f6bd31b11072af27ccc
parentf04a9f0cdea30e626826286107426b24f684ece6
Fix gctest in leak-finding mode
(a cherry-pick of commits 4e909d28568ff0 from 'master')

Also, print the message about the leak-find mode just once per gctest
execution.

* tests/test.c (INIT_FIND_LEAK): Define macro.
* tests/test.c (GC_COND_INIT): Invoke INIT_FIND_LEAK.
* tests/test.c [!FIND_LEAK] (mktree): Do not call GC_REGISTER_FINALIZER
and GC_GENERAL_REGISTER_DISAPPEARING_LINK if GC_get_find_leak().
* tests/test.c (run_one_test): Replace "ifdef FIND_LEAK" with
if(GC_get_find_leak()).
* tests/test.c (run_one_test): Remove print about leak-find mode.
* tests/test.c (check_heap_stats): Do not fail on unexpected heap
growth if GC_get_find_leak().
* tests/test.c [!GC_NO_FINALIZATION] (check_heap_stats): Move
still_live and still_long_live local variables to the block of their
usage.
tests/test.c