This commit is contained in:
Andreas Rumpf 2020-07-27 23:27:20 +02:00 • committed by GitHub
commit e6f0d4a5a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 28 deletions

21
tests/arc/tasyncleak.nim Normal file
View file

@ -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()