Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Aug 2, 2023
1 parent 4a854bd commit 9880554
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/gc/t22173.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
discard """
cmd: '''nim c --gc:refc -r $file'''
"""
const Memo = 100 * 1024

proc fff(v: sink string): iterator(): char =
return iterator(): char =
for c in v:
yield c

var tmp = newString(Memo)

let iter = fff(move(tmp))

while true:
let v = iter()
if finished(iter):
break

doAssert getOccupiedMem() < Memo * 3

0 comments on commit 9880554

Please sign in to comment.