M&S GC: minor code cleanup

This commit is contained in:
Andreas Rumpf 2018-01-21 21:06:31 +01:00
commit 8c98277d5a

View file

@ -347,12 +347,6 @@ proc growObj(old: pointer, newsize: int, gch: var GcHeap): pointer =
zeroMem(cast[pointer](cast[ByteAddress](res)+% oldsize +% sizeof(Cell)), zeroMem(cast[pointer](cast[ByteAddress](res)+% oldsize +% sizeof(Cell)),
newsize-oldsize) newsize-oldsize)
sysAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "growObj: 3") sysAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "growObj: 3")
when false:
# this is wrong since seqs can be shared via 'shallow':
when withBitvectors: excl(gch.allocated, ol)
when reallyDealloc: rawDealloc(gch.region, ol)
else:
zeroMem(ol, sizeof(Cell))
when withBitvectors: incl(gch.allocated, res) when withBitvectors: incl(gch.allocated, res)
when useCellIds: when useCellIds:
inc gch.idGenerator inc gch.idGenerator