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
This commit is contained in:
Andreas Rumpf 2021-05-18 21:45:37 +02:00 • committed by GitHub
commit 53935b8b27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,13 @@
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()