Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nitely committed Dec 21, 2024
1 parent bd40043 commit 5e6ff58
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/async/t23212.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
discard """
cmd: '''nim c --mm:arc -d:nimAllocStats $file'''
output: '''1000
(allocCount: 9010, deallocCount: 9004)'''
"""

import std/asyncdispatch

var count: int

proc stuff() {.async.} =
#echo count, 1
await sleepAsync(1)
#echo count, 2
count.inc

for _ in 0..<1000:
asyncCheck stuff()

while hasPendingOperations(): poll()

echo count
echo getAllocStats()

0 comments on commit 5e6ff58

Please sign in to comment.