quote:
Originally posted by Verte
That's what they should do. But, if you use pointers anywhere, you've got to be very careful with GC. For example, if you pass a pointer variable to a subroutine, and the subroutine uses a temp variable to represent that variable inside, assigns a new object on the heap to the temp variable, and then the temp variable goes out of scope, most GCs will free the object. In cases such as these, you've got to increment the reference counter by hand, which is to say that you're essentially doing manual garbage collection anyway. This is because Garbage collection typically only tracks direct assignments, and where one variable may reference an object indirectly [such as through an array of pointers or references] the GC will not count the [second-order] reference.
IMO, you know when you're done with data, you deal with it.
thats why GC languages don't use pointers, they use references