Closed arnetheduck closed 3 months ago
swap(a, b); reset(b)
works around :facepalm:
Let me tell you a secret: refc
really does not support move semantics. Or destructors. Or sink
parameters.
Let me tell you a secret: refc really does not support move semantics. Or destructors. Or sink parameters.
works for seq - don't see why it shouldn't work here?
refc
really does not support move semantics. Or destructors. Orsink
parameters.
Maybe that should be made more explicit in the docs ? 🤔
Maybe that should be made more explicit in the docs ? 🤔
Sure but there is a reason we used the version number 2.0 and it defaults to mm:orc
. Supporting refc with move semantics is a whack-a-mole game as it was never designed for this.
@arnetheduck it doesn't work for base cases for seq
though
var a, b: seq[int]
a = move(b)
Which generates genericSeqAssign
in the c code.
https://github.com/nim-lang/Nim/pull/22229 made it conversative to move data since 2.0.0. 1.6.x does move tables.
https://github.com/nim-lang/Nim/pull/22229 made it conversative to move data since 2.0.0. 1.6.x does moves tables.
ok, I'm not going mad at least, I was pretty sure I had seen move take effect when investigating poor performance while on 1.6 ;)
move
helps us migrate signfificant amounts of code away from shallowCopy
and other pure-refc constructs but we cannot do that if it makes the applications significantly slower (which additional copies do) - it would be great if we could address some of these lack-of-move issues for refc in 2.0 (we don't care about other orc:isms such as destructors since these are new features - sink, lent etc are pre-2.0 and pre-orc features that are important migration bridges)
Description
a copy is generated even if a move is requested:
orc moves.
Nim Version
2.0.6/refc
Current Output
No response
Expected Output
No response
Possible Solution
No response
Additional Information
No response