mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-25 16:53:59 +00:00
c2nim compiles again
This commit is contained in:
@@ -420,7 +420,7 @@ proc newObjRC1(typ: PNimType, size: int): pointer {.compilerRtl.} =
|
||||
if framePtr != nil and framePtr.prev != nil:
|
||||
res.filename = framePtr.prev.filename
|
||||
res.line = framePtr.prev.line
|
||||
res.refcount = rcIncrement # refcount is 1
|
||||
res.refcount = rcIncrement # refcount is 1
|
||||
sysAssert(isAllocatedPtr(gch.region, res), "newObj: 3")
|
||||
when logGC: writeCell("new cell", res)
|
||||
gcTrace(res, csAllocated)
|
||||
|
||||
@@ -52,7 +52,7 @@ proc copyStrLast(s: NimString, start, last: int): NimString {.compilerProc.} =
|
||||
c_memcpy(result.data, addr(s.data[start]), len * sizeof(Char))
|
||||
result.data[len] = '\0'
|
||||
else:
|
||||
result = mnewString(0)
|
||||
result = rawNewString(len)
|
||||
|
||||
proc copyStr(s: NimString, start: int): NimString {.compilerProc.} =
|
||||
result = copyStrLast(s, start, s.len-1)
|
||||
|
||||
Reference in New Issue
Block a user