first version of a simple mark&sweep GC; activate with --gc:markAndSweep
This commit is contained in:
parent
f96d612e98
commit
ab6f793408
12 changed files with 834 additions and 89 deletions
|
|
@ -202,7 +202,8 @@ proc setLengthSeq(seq: PGenericSeq, elemSize, newLen: int): PGenericSeq {.
|
|||
GenericSeqSize))
|
||||
elif newLen < result.len:
|
||||
# we need to decref here, otherwise the GC leaks!
|
||||
when not defined(boehmGC) and not defined(nogc):
|
||||
when not defined(boehmGC) and not defined(nogc) and
|
||||
not defined(gcMarkAndSweep):
|
||||
when compileOption("gc", "v2"):
|
||||
for i in newLen..result.len-1:
|
||||
let len0 = gch.tempStack.len
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue