mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
improve code generation for custom strings/seqs
This commit is contained in:
@@ -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) =
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user