--gc:destructors: hello world example compiles and runs
This commit is contained in:
parent
2eb14bdd41
commit
4bd9f32f33
4 changed files with 13 additions and 3 deletions
|
|
@ -125,7 +125,7 @@ proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =
|
|||
if newLen <= oldLen: return
|
||||
var xu = cast[ptr NimSeqV2[T]](addr x)
|
||||
|
||||
xu.p = prepareSeqAdd(oldLen, xu.p, newLen - oldLen, sizeof(T))
|
||||
xu.p = cast[typeof(xu.p)](prepareSeqAdd(oldLen, xu.p, newLen - oldLen, sizeof(T)))
|
||||
xu.len = newLen
|
||||
for i in oldLen .. newLen-1:
|
||||
x.data[i] = value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue