tasyncleak.nim 490 B

12345678910111213141516171819202122
  1. discard """
  2. outputsub: "(allocCount: 4050, deallocCount: 4048)"
  3. cmd: "nim c --gc:orc -d:nimAllocStats $file"
  4. """
  5. import asyncdispatch
  6. # bug #15076
  7. const
  8. # Just to occupy some RAM
  9. BigData = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  10. proc doNothing(): Future[void] {.async.} =
  11. discard
  12. proc main(): Future[void] {.async.} =
  13. for x in 0 .. 1_000:
  14. await doNothing()
  15. waitFor main()
  16. GC_fullCollect()
  17. echo getAllocStats()