-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace shallowCopy for ARC/ORC #4
base: master
Are you sure you want to change the base?
Conversation
Hi @ringabout, thank you for the PR. But I must say I am confused - isn't there a mechanism to share storage with ORC? The whole point of the |
Imo, strings and seqs cannot be shared with ARC/ORC in a safe way. It can be either moved or copied. Sometimes it can be optimized using |
I think the only workaround that can actually work in this case without changing semantics is creating some |
You could use a cow string implementation internally. |
I think I will go with double indirection as soon as I have time |
I'm not sure how to achieve that while keeping this test work proc rotate*(s: string, i: int): RotatedString
test "underlying strings are shared":
var
x = "Hello, world"
y = x.rotate(5)
y[0] = 'f'
check x[5] == 'f' |
Hello,
shallowCopy
has been removed for ARC/ORC since it does a deep copy with ARC/ORC → nim-lang/Nim#20070I don't know a good alternative for
shallowCopy
.ref nim-lang/Nim#19972