newObj can clear memory, even when using malloc and nogc

This commit is contained in:
Jacek Sieka
2016-03-07 22:38:22 +08:00
parent e4e8ebd4a5
commit 9928b9f48d

View File

@@ -427,7 +427,7 @@ elif defined(nogc) and defined(useMalloc):
proc initGC() = discard
proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} =
result = alloc(size)
result = alloc0(size)
proc newSeq(typ: PNimType, len: int): pointer {.compilerproc.} =
result = newObj(typ, addInt(mulInt(len, typ.base.size), GenericSeqSize))
cast[PGenericSeq](result).len = len