bugfix: mark&sweep GC

This commit is contained in:
Araq 2013-03-29 16:36:24 +01:00
commit e24305f1e1

View file

@ -312,6 +312,8 @@ proc chunkUnused(c: PChunk): bool {.inline.} =
iterator allObjects(m: TMemRegion): pointer {.inline.} = iterator allObjects(m: TMemRegion): pointer {.inline.} =
for s in elements(m.chunkStarts): for s in elements(m.chunkStarts):
# we need to check here again as it could have been modified:
if s in m.chunkStarts:
let c = cast[PChunk](s shl PageShift) let c = cast[PChunk](s shl PageShift)
if not chunkUnused(c): if not chunkUnused(c):
if isSmallChunk(c): if isSmallChunk(c):