summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-25 08:37:05 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-25 08:37:05 +0300
commit2e5646ba3d954da3f45985630281aadfc686f55b (patch)
treeb58fe3d21f8d585ee3774a781b498e383f8731f6 /tests
parent72191d191fb4272b8e626c4db7763023d41d7f88 (diff)
downloadbdwgc-2e5646ba3d954da3f45985630281aadfc686f55b.tar.gz
Fix infinite loop in disable_gc_for_dlopen and GC_wait_for_gc_completion
Issue #257 (bdwgc). * alloc.c (GC_start_incremental_collection, GC_collect_a_little): Do not call GC_collect_a_little_inner() and ENTER/EXIT_GC() if GC_dont_gc. * alloc.c (GC_collect_a_little_inner): Call GC_mark_some() (in a loop) even if GC_dont_gc. * alloc.c (GC_allocobj): Do not call GC_collect_a_little_inner() if GC_dont_gc. * tests/gctest.c (check_heap_stats): Do not call GC_collect_a_little() (repeatedly) if GC_is_disabled().
Diffstat (limited to 'tests')
-rw-r--r--tests/gctest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/gctest.c b/tests/gctest.c
index 0715ba40..d50a9f61 100644
--- a/tests/gctest.c
+++ b/tests/gctest.c
@@ -1972,7 +1972,8 @@ void check_heap_stats(void)
# endif
/* Garbage collect repeatedly so that all inaccessible objects */
/* can be finalized. */
- while (GC_collect_a_little()) { }
+ if (!GC_is_disabled())
+ while (GC_collect_a_little()) { }
for (i = 0; i < 16; i++) {
GC_gcollect();
# ifndef GC_NO_FINALIZATION