mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 14:23:45 +00:00
* ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] * Update tests/arc/tnewseq_legacy.nim
14 lines
258 B
Nim
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()
|