This commit is contained in:
Araq 2015-02-05 12:19:19 +01:00
commit 683b82a2ec
2 changed files with 29 additions and 19 deletions

View file

@ -297,10 +297,12 @@ proc growObj(old: pointer, newsize: int, gch: var TGcHeap): pointer =
zeroMem(cast[pointer](cast[ByteAddress](res)+% oldsize +% sizeof(TCell)),
newsize-oldsize)
sysAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "growObj: 3")
when withBitvectors: excl(gch.allocated, ol)
when reallyDealloc: rawDealloc(gch.region, ol)
else:
zeroMem(ol, sizeof(TCell))
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(TCell))
when withBitvectors: incl(gch.allocated, res)
when useCellIds:
inc gch.idGenerator