first implementation of the new --seqsv2 switch
This commit is contained in:
parent
ed2fb36bc6
commit
0eae2217b6
7 changed files with 22 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue