diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-07-27 23:27:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-27 23:27:20 +0200 |
commit | e6f0d4a5a59f8230133481d25ce1c3f6e8daf0a5 (patch) | |
tree | 4a5081869ac285012a06851fd2a74cbdd0a4b8ad /tests | |
parent | 377f71676629d5621d052e662996d30323ea3bee (diff) | |
download | Nim-e6f0d4a5a59f8230133481d25ce1c3f6e8daf0a5.tar.gz |
fixes #15076 (#15095)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arc/tasyncleak.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/arc/tasyncleak.nim b/tests/arc/tasyncleak.nim new file mode 100644 index 000000000..16e7446a7 --- /dev/null +++ b/tests/arc/tasyncleak.nim @@ -0,0 +1,21 @@ +discard """ + outputsub: "(allocCount: 6013, deallocCount: 6007)" + cmd: "nim c --gc:orc -d:nimAllocStats $file" +""" + +import asyncdispatch +# bug #15076 +const + # Just to occupy some RAM + BigData = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + +proc doNothing(): Future[void] {.async.} = + discard + +proc main(): Future[void] {.async.} = + for x in 0 .. 1_000: + await doNothing() + +waitFor main() +GC_fullCollect() +echo getAllocStats() |