summary refs log tree commit diff stats
path: root/tests/gc/weakrefs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gc/weakrefs.nim')
-rw-r--r--tests/gc/weakrefs.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/gc/weakrefs.nim b/tests/gc/weakrefs.nim
index 3b12d7998..0a6d4b873 100644
--- a/tests/gc/weakrefs.nim
+++ b/tests/gc/weakrefs.nim
@@ -40,6 +40,8 @@ proc main =
   for i in 0 .. s.high:
     s[i] = register(create())
   # test that we have at least 80% unreachable weak objects by now:
+  when defined(gcMarkAndSweep):
+    GC_fullcollect()
   var unreachable = 0
   for i in 0 .. s.high:
     if access(s[i]) == nil: inc unreachable