summary refs log tree commit diff stats
path: root/tests/gc/gcleak3.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gc/gcleak3.nim')
-rw-r--r--[-rwxr-xr-x]tests/gc/gcleak3.nim11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/gc/gcleak3.nim b/tests/gc/gcleak3.nim
index 70aeda3bb..5e146d69f 100755..100644
--- a/tests/gc/gcleak3.nim
+++ b/tests/gc/gcleak3.nim
@@ -2,6 +2,9 @@ discard """
   outputsub: "no leak: "
 """
 
+when defined(GC_setMaxPause):
+  GC_setMaxPause 2_000
+
 type
   TSomething = object
     s: string
@@ -14,14 +17,10 @@ for i in 0..1024:
   s.add(obj)
 
 proc limit*[t](a: var seq[t]) =
-  var loop = s.len() - 512
-  for i in 0..loop:
-    #echo i
-    #GC_fullCollect()
+  while s.len > 0:
     if getOccupiedMem() > 3000_000: quit("still a leak!")
-    s.delete(i)
+    s.delete(0)
 
 s.limit()
-
 echo "no leak: ", getOccupiedMem()