gc:destructors: progress

This commit is contained in:
Andreas Rumpf 2019-02-28 22:39:15 +01:00
commit 728ff1004a
6 changed files with 85 additions and 2 deletions

View file

@ -118,7 +118,7 @@ proc shrink*[T](x: var seq[T]; newLen: Natural) =
when not supportsCopyMem(T):
for i in countdown(x.len - 1, newLen - 1):
`=destroy`(x[i])
# XXX This is wrong for const seqs that were moved into 'x'!
cast[ptr NimSeqV2[T]](addr x).len = newLen
proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =