summary refs log tree commit diff stats
path: root/tests/arc/tasyncleak.nim
blob: eb0c4521311bce9e290dab87da36a9f5b3e40cf8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
discard """
  outputsub: "(allocCount: 4302, deallocCount: 4300)"
  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()