summary refs log tree commit diff stats
path: root/tests/gc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-10 02:03:11 +0100
committerAraq <rumpf_a@web.de>2015-02-10 20:19:47 +0100
commiteec18896b760059af62a7cb63a151339f44c5f66 (patch)
tree7de370a84cfcb0bc4d5af47674b56c26cceca321 /tests/gc
parent865d341b3230f235765705fca156e286b7b6b43b (diff)
downloadNim-eec18896b760059af62a7cb63a151339f44c5f66.tar.gz
cleaned up GC tests; fixes object variant re-assign bug
Diffstat (limited to 'tests/gc')
-rw-r--r--tests/gc/gcleak4.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/gc/gcleak4.nim b/tests/gc/gcleak4.nim
index 6f2b8a1fe..54e74ac7b 100644
--- a/tests/gc/gcleak4.nim
+++ b/tests/gc/gcleak4.nim
@@ -38,12 +38,14 @@ proc newPlus(a, b: ref TExpr): ref TPlusExpr =
   result.b = b
   result.op2 = $getOccupiedMem()
 
+const Limit = when compileOption("gc", "markAndSweep"): 5*1024*1024 else: 500_000
+
 for i in 0..100_000:
   var s: array[0..11, ref TExpr]
   for j in 0..high(s):
     s[j] = newPlus(newPlus(newLit(j), newLit(2)), newLit(4))
     if eval(s[j]) != j+6:
       quit "error: wrong result"
-  if getOccupiedMem() > 500_000: quit("still a leak!")
+  if getOccupiedMem() > Limit: quit("still a leak!")
 
 echo "no leak: ", getOccupiedMem()