From 0eae2217b69541ea8ce1cf6509732928fb0869ee Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 19 Oct 2019 19:30:48 +0200 Subject: first implementation of the new --seqsv2 switch --- lib/system/excpt.nim | 2 +- lib/system/gc_ms.nim | 4 ++-- lib/system/mmdisp.nim | 2 +- lib/system/repr.nim | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/system') diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 1eb4cedc8..e3448ff4c 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -439,7 +439,7 @@ proc getStackTrace(e: ref Exception): string = proc getStackTraceEntries*(e: ref Exception): seq[StackTraceEntry] = ## Returns the attached stack trace to the exception ``e`` as ## a ``seq``. This is not yet available for the JS backend. - when not defined(gcDestructors): + when not defined(nimSeqsV2): shallowCopy(result, e.trace) else: result = move(e.trace) diff --git a/lib/system/gc_ms.nim b/lib/system/gc_ms.nim index 3ce428930..271543445 100644 --- a/lib/system/gc_ms.nim +++ b/lib/system/gc_ms.nim @@ -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) diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index cba88104d..de89acd33 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -518,7 +518,7 @@ else: else: include "system/gc" -when not declared(nimNewSeqOfCap) and not defined(gcDestructors): +when not declared(nimNewSeqOfCap) and not defined(nimSeqsV2): proc nimNewSeqOfCap(typ: PNimType, cap: int): pointer {.compilerproc.} = when defined(gcRegions): let s = mulInt(cap, typ.base.size) # newStr already adds GenericSeqSize diff --git a/lib/system/repr.nim b/lib/system/repr.nim index 97975277b..0c7848c75 100644 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -160,7 +160,7 @@ when not defined(useNimRtl): reprAux(result, cast[pointer](cast[ByteAddress](p) + i*bs), typ.base, cl) add result, "]" - when defined(gcDestructors): + when defined(nimSeqsV2): type GenericSeq = object len: int -- cgit 1.4.1-2-gfad0