further progress; more tests are green

This commit is contained in:
Araq
2016-11-28 21:45:29 +01:00
parent 27723af469
commit 49667798eb
5 changed files with 24 additions and 25 deletions

View File

@@ -461,6 +461,7 @@ proc rawNewObj(typ: PNimType, size: int, gch: var GcHeap): pointer =
gcAssert(typ.kind in {tyRef, tyString, tySequence}, "newObj: 1")
collectCT(gch)
var res = cast[PCell](rawAlloc(gch.region, size + sizeof(Cell)))
gcAssert typ.kind == tyString or size >= typ.base.size, "size too small"
gcAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "newObj: 2")
# now it is buffered in the ZCT
res.typ = typ