.byref always optimizes sink call into a bitwise memcopy if =sink is disabled#24327
.byref always optimizes sink call into a bitwise memcopy if =sink is disabled#24327ringabout wants to merge 2 commits into
.byref always optimizes sink call into a bitwise memcopy if =sink is disabled#24327Conversation
| (isAnalysableFieldAccess(dest, c.owner) and isFirstWrite(dest, c)))) or | ||
| isNoInit(dest) or IsReturn in flags: | ||
| isNoInit(dest) or IsReturn in flags or | ||
| tfByRef in dest.typ.flags: |
There was a problem hiding this comment.
I think the logic should be "it's .byref and also has its =sink disabled".
.byref always optimizes sink call into a bitwise memcopy.byref always optimizes sink call into a bitwise memcopy if =sink is disabled
|
This is still not correct as it can introduce leaks for code like |
|
I usually use |
|
I think so, yes, but making =sink an .error just because you want to tie the object to a stack location is wrong regardless. |
closes #75
ref nim-lang/threading#79
Or only when
=sinkis disabled forbyRef