as we know, string in nim is value type, but i do not know the type of cstring. so i wrote a snippet:
var y = "abc"
let z = cstring(y)
y.add("d")
# when mm:arc
# assert y == "abcd"
# assert z == cstring"abc"
# when mm:refc
assert y == "abcd"
assert z == cstring"abcd"
when mm == refc, it's like a ref or ptr; but when mm == arc, it's like a value type; i was so confused. thanks for help!
ps: this question was originated from this pr that says there is a memory leak with cstring.