In article <nmiMj.1500$pS4.400@newssvr13.news.prodigy.net>,
mscottschilling@hotmail.com says...
1. Plus the fact that if you have enough information to do GC, you
have more than enough to make compaction work.
Not really. A typical gc in C++ is added on after the fact, so it
does
conservative collection -- since it doesn't know what is or isn't a
pointer, it treats everything as if it was a pointer, and assumes
that
whatever if would point at if it was as pointer is live memory. Of
course, some values wouldn't be valid pointers and are eliminated.
It does NOT, however, know with any certainty that a particular
value IS
a pointer -- some definitely aren't (valid) pointers, but others
might
or might not be. Since it doesn't know for sure which are pointers
and
which are just integers (or whatever) that hold values that could be
pointers, it can't modify any of them. It has enough information to
do
garbage collection, but NOT enough to support compacting the heap.
You make a good point. I overlooked conservative collectors.