scoped memory management (#14790)
* fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
This commit is contained in:
parent
695154970d
commit
1854d29781
17 changed files with 611 additions and 477 deletions
|
|
@ -247,7 +247,7 @@ iterator combinations[T](s: openarray[T], k: int): seq[T] =
|
|||
break
|
||||
|
||||
type
|
||||
UndefEx = object of Exception
|
||||
UndefEx = object of ValueError
|
||||
|
||||
proc main2 =
|
||||
var delayedSyms = @[1, 2, 3]
|
||||
|
|
@ -318,10 +318,10 @@ proc `=sink`(dest: var O2, src: O2) =
|
|||
|
||||
var testSeq: O2
|
||||
|
||||
proc Update(): void =
|
||||
proc update() =
|
||||
# testSeq.add(0) # uncommenting this line fixes the leak
|
||||
testSeq = O2(s: @[])
|
||||
testSeq.s.add(0)
|
||||
|
||||
for i in 1..3:
|
||||
Update()
|
||||
update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue