first implementation of the new --seqsv2 switch

This commit is contained in:
Araq 2019-10-19 19:30:48 +02:00 • committed by Andreas Rumpf
commit 0eae2217b6
7 changed files with 22 additions and 15 deletions

View file

@ -254,7 +254,7 @@ proc forAllChildren(cell: PCell, op: WalkOp) =
of tyRef: # common case
forAllChildrenAux(cellToUsr(cell), cell.typ.base, op)
of tySequence:
when not defined(gcDestructors):
when not defined(nimSeqsV2):
var d = cast[ByteAddress](cellToUsr(cell))
var s = cast[PGenericSeq](d)
if s != nil:
@ -304,7 +304,7 @@ proc newObjRC1(typ: PNimType, size: int): pointer {.compilerRtl.} =
zeroMem(result, size)
when defined(memProfiler): nimProfile(size)
when not defined(gcDestructors):
when not defined(nimSeqsV2):
proc newSeq(typ: PNimType, len: int): pointer {.compilerRtl.} =
# `newObj` already uses locks, so no need for them here.
let size = addInt(mulInt(len, typ.base.size), GenericSeqSize)