Please see below ...
Joe.
[Joe da Silva]
No, the last statement cannot result in a new assignment for the reference pointer. That's just unacceptable. That's why Frank was saying you needed "double pointers", so that you could specifically set the reference pointer to "nil" when you disposed it's corresponding store pointer. So, the subsequent "new" statement would not re-assign the reference pointer - if that's what you (ie. the programmer) want, you assign it explicitly after the "new" statement.
You could also search the reference pointers when disposing a store pointer, to find out which of these are affected, but that would be inefficient (like GC;-).
da Silva, Joe wrote:
It's always easy to make such claims, but I've yet to see a solution (for the general case) that is more efficient, considering any hidden costs?
BTW, have you studied GC algorithms? I haven't, but I've see that some research has done in this area and a good GC algorithm is quite a bit better than an implementation I'd come up with if I tried it naively ...
Frank