This way of having inner reference types is an expensive operation that requires many calls to malloc/free and a significant reference counting overhead each time you copy.
I have a test case for struct with inner reference type.
I have a test case for struct with inner reference type. The code and output is in the following gist: https://gist.github.com/vitonzhangtt/a89949daa92641b7ea55d4e2cbaca436 According to the output, I have a conclusion: The assignment operation of struct variables with inner reference type properties will not trigger malloc/free. I would like to hear your opinions about this.