Gc/D_runtime prevents dangling pointers?

tipdbmp email at example.com
Thu Jan 4 11:05:25 UTC 2018


> What is your definition of a dangling pointer?
A pointer pointing to freed memory, which presumably '&a[0]' 
should be because it reallocates.

It seems that the '~=' operator "knows" that there's a reference 
to 'a's old memory and it keeps it around instead of freeing it.
I just don't understand the mechanism behind this.



More information about the Digitalmars-d-learn mailing list