Fix gc tests for BoehmGC (#7094)

This commit is contained in:
Sergey Avseyev
2018-01-18 11:04:32 +03:00
committed by Andreas Rumpf
parent b754bfabb6
commit d9c922fc70
3 changed files with 3 additions and 6 deletions

View File

@@ -13,11 +13,10 @@ proc MakeObj(): TTestObj =
result.x = "Hello"
for i in 1 .. 1_000_000:
when defined(gcMarkAndSweep):
when defined(gcMarkAndSweep) or defined(boehmgc):
GC_fullcollect()
var obj = MakeObj()
if getOccupiedMem() > 300_000: quit("still a leak!")
# echo GC_getstatistics()
echo "no leak: ", getOccupiedMem()

View File

@@ -16,7 +16,7 @@ proc MakeObj(): TTestObj =
proc inProc() =
for i in 1 .. 1_000_000:
when defined(gcMarkAndSweep):
when defined(gcMarkAndSweep) or defined(boehmgc):
GC_fullcollect()
var obj: TTestObj
obj = MakeObj()
@@ -24,5 +24,3 @@ proc inProc() =
inProc()
echo "no leak: ", getOccupiedMem()

View File

@@ -38,7 +38,7 @@ 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
const Limit = when compileOption("gc", "markAndSweep") or compileOption("gc", "boehm"): 5*1024*1024 else: 500_000
for i in 0..100_000:
var s: array[0..11, ref TExpr]