introduce tfHasOwned for fast must-move checkings; removed tfAcyclic as the GC has ignored this hint for quite some time now
This commit is contained in:
parent
20a21aa184
commit
4be36d77f6
9 changed files with 30 additions and 63 deletions
|
|
@ -479,7 +479,7 @@ type
|
|||
tfNoSideEffect, # procedure type does not allow side effects
|
||||
tfFinal, # is the object final?
|
||||
tfInheritable, # is the object inheritable?
|
||||
tfAcyclic, # type is acyclic (for GC optimization)
|
||||
tfHasOwned, # type contains an 'owned' type and must be moved
|
||||
tfEnumHasHoles, # enum cannot be mapped into a range
|
||||
tfShallow, # type can be shallow copied on assignment
|
||||
tfThread, # proc type is marked as ``thread``; alias for ``gcsafe``
|
||||
|
|
@ -1472,6 +1472,13 @@ proc propagateToOwner*(owner, elem: PType) =
|
|||
o2.flags.incl tfHasAsgn
|
||||
owner.flags.incl tfHasAsgn
|
||||
|
||||
if tfHasOwned in elem.flags:
|
||||
let o2 = owner.skipTypes({tyGenericInst, tyAlias, tySink})
|
||||
if o2.kind in {tyTuple, tyObject, tyArray,
|
||||
tySequence, tyOpt, tySet, tyDistinct}:
|
||||
o2.flags.incl tfHasOwned
|
||||
owner.flags.incl tfHasOwned
|
||||
|
||||
if owner.kind notin {tyProc, tyGenericInst, tyGenericBody,
|
||||
tyGenericInvocation, tyPtr}:
|
||||
let elemB = elem.skipTypes({tyGenericInst, tyAlias, tySink})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue