improve code generation for custom strings/seqs

This commit is contained in:
Andreas Rumpf
2017-10-13 14:25:56 +02:00
parent f9dc204a0f
commit 4eaa2bf15d
2 changed files with 4 additions and 4 deletions

View File

@@ -278,7 +278,7 @@ proc ccgIntroducedPtr(s: PSym): bool =
elif tfByCopy in pt.flags: return false
case pt.kind
of tyObject:
if (optByRef in s.options) or (getSize(pt) > platform.floatSize * 2):
if (optByRef in s.options) or (getSize(pt) > platform.floatSize * 3):
result = true # requested anyway
elif (tfFinal in pt.flags) and (pt.sons[0] == nil):
result = false # no need, because no subtyping possible
@@ -286,7 +286,7 @@ proc ccgIntroducedPtr(s: PSym): bool =
result = true # ordinary objects are always passed by reference,
# otherwise casting doesn't work
of tyTuple:
result = (getSize(pt) > platform.floatSize*2) or (optByRef in s.options)
result = (getSize(pt) > platform.floatSize*3) or (optByRef in s.options)
else: result = false
proc fillResult(param: PNode) =

View File

@@ -290,7 +290,7 @@ proc injectDestructorCalls*(owner: PSym; n: PNode): PNode =
else:
result.add body
when false:
when defined(nimDebugDestroys):
echo "------------------------------------"
echo owner.name.s, " transformed from: ", n
echo owner.name.s, " transformed to: "
echo result