ARC: ported the GC tests over to --gc:arc

This commit is contained in:
Araq 2019-11-25 15:29:41 +01:00 • committed by Andreas Rumpf
commit 72237e2bcf
14 changed files with 79 additions and 29 deletions

View file

@ -19,8 +19,15 @@ var
proc finalizer(x: StrongObject) =
valid.excl(x.id)
when defined(gcDestructors):
proc `=destroy`(x: var TMyObject) =
valid.excl(x.id)
proc create: StrongObject =
new(result, finalizer)
when defined(gcDestructors):
new(result)
else:
new(result, finalizer)
result.id = gid
valid.incl(gid)
inc gid