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:
Andreas Rumpf 2020-07-04 07:37:24 +02:00 • committed by GitHub
commit 1854d29781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 611 additions and 477 deletions

View file

@ -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()