mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-01 03:24:41 +00:00
ARC: fixes leaking new() statement (#12665)
This commit is contained in:
@@ -43,9 +43,18 @@ proc tlazyList =
|
||||
var x = LazyList(c: proc () = echo(dep))
|
||||
x.c()
|
||||
|
||||
type
|
||||
Foo = ref object
|
||||
|
||||
proc tleakingNewStmt =
|
||||
var x: Foo
|
||||
for i in 0..10:
|
||||
new(x)
|
||||
|
||||
let startMem = getOccupiedMem()
|
||||
tlazyList()
|
||||
|
||||
mkManyLeaks()
|
||||
tsimpleClosureIterator()
|
||||
tleakingNewStmt()
|
||||
echo getOccupiedMem() - startMem
|
||||
|
||||
Reference in New Issue
Block a user