turn destructors into finalizers

This commit is contained in:
Andreas Rumpf 2018-07-05 11:31:27 +02:00
commit 9b31f67859
3 changed files with 40 additions and 6 deletions

View file

@ -6,16 +6,16 @@ when defined(GC_setMaxPause):
GC_setMaxPause 2_000
type
TTestObj = object of TObject
TTestObj = object of RootObj
x: string
proc MakeObj(): TTestObj =
proc makeObj(): TTestObj =
result.x = "Hello"
for i in 1 .. 1_000_000:
when defined(gcMarkAndSweep) or defined(boehmgc):
GC_fullcollect()
var obj = MakeObj()
var obj = makeObj()
if getOccupiedMem() > 300_000: quit("still a leak!")
# echo GC_getstatistics()