Files
Nim/tests/arc/tnewseq_legacy.nim
Andreas Rumpf 53935b8b27 ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] (#18040)
* ARC: fixes memory leaks with newSeq used in a loop [backport:1.4]
* Update tests/arc/tnewseq_legacy.nim
2021-05-18 21:45:37 +02:00

14 lines
258 B
Nim

discard """
output: "(allocCount: 201, deallocCount: 201)"
cmd: "nim c --gc:orc -d:nimAllocStats $file"
"""
proc main(prefix: string) =
var c: seq[string]
for i in 0..<100:
newSeq(c, 100)
c[i] = prefix & $i
main("abc")
echo getAllocStats()