H
haitao.song
Hi,
As it is always stated that value type is allocated on stack, while
reference types are on managed heap. How about the struct with
string members?
stuct A { string str; }
String type is considered as reference type.... My guess is the
struct A is actually a valuetype with a string reference/address.
So it acts as if struct A { int ptrStr; } Anyway, the ptrStr is like a
pointer (integer value) to a non-mutable reference string on heap.
Some suggestions? How does it work? Under GC, does all copies
of A gets updated with the string reference value?
As it is always stated that value type is allocated on stack, while
reference types are on managed heap. How about the struct with
string members?
stuct A { string str; }
String type is considered as reference type.... My guess is the
struct A is actually a valuetype with a string reference/address.
So it acts as if struct A { int ptrStr; } Anyway, the ptrStr is like a
pointer (integer value) to a non-mutable reference string on heap.
Some suggestions? How does it work? Under GC, does all copies
of A gets updated with the string reference value?