diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-12-17 17:37:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-17 17:37:50 +0100 |
commit | 83a736a34a1ebd4bc4d769429880ccb871403ba4 (patch) | |
tree | 1a45de64686622fe9932daafb5345fdd066cab48 /tests/destructor/tarc2.nim | |
parent | 5848f0042c2d6a6dd39d9b8db747f36200c9f543 (diff) | |
download | Nim-83a736a34a1ebd4bc4d769429880ccb871403ba4.tar.gz |
ARC: cycle detector (#12823)
* first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
Diffstat (limited to 'tests/destructor/tarc2.nim')
-rw-r--r-- | tests/destructor/tarc2.nim | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/destructor/tarc2.nim b/tests/destructor/tarc2.nim index 56dbfe929..bd6343b2f 100644 --- a/tests/destructor/tarc2.nim +++ b/tests/destructor/tarc2.nim @@ -1,6 +1,6 @@ discard """ - output: '''leak: true''' - cmd: '''nim c --gc:arc $file''' + output: '''leak: false''' + cmd: '''nim c --gc:orc $file''' """ type @@ -19,11 +19,8 @@ proc addX(x: T; child: T) = proc main(rootName: string) = var root = create() root.data = rootName - # this implies we do the refcounting wrong. We should leak memory here - # and not create a destruction cycle: root.addX root let mem = getOccupiedMem() main("yeah") -# since we created a retain cycle, we MUST leak memory here: echo "leak: ", getOccupiedMem() - mem > 0 |